Hi there,
I have a bunch of code which transfers data to an Excel file via queries.
When I select, say, 'C' drive (any drive/folder) the code executes without problems and I can run this over-and-over again.
However, if I try and save to desktop (redirection), it may work the first time but then errors thereafter: 3274 - external table is not in the expected format
It seems to fail around here and not on any particular line:-
If I close the DB then open it again it seems to reset itself, works the first time and then errors next time.
I also use this code to capture trailing '\' in the filename:-
Thanks in advance and regards.
I have a bunch of code which transfers data to an Excel file via queries.
When I select, say, 'C' drive (any drive/folder) the code executes without problems and I can run this over-and-over again.
However, if I try and save to desktop (redirection), it may work the first time but then errors thereafter: 3274 - external table is not in the expected format
It seems to fail around here and not on any particular line:-
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qry_Export1", strFilename
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qry_Export2", strFilename
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qry_Export3", strFilename
If I close the DB then open it again it seems to reset itself, works the first time and then errors next time.
I also use this code to capture trailing '\' in the filename:-
Code:
If Right(strFilename, 1) = "\" Then
strFilename = strFilename & myExportfilename
Else
strFilename = strFilename & "\" & myExportfilename
End If
Thanks in advance and regards.