S
SimonG via AccessMonster.com
Trying to export Access query to an Excel spreadsheet.
Ultimately several querys will be exported, each to its own worksheet within
a single workbook.
The workbook does not need to be opened, as no user intervention is required
(eventually the workbook will be used as an import for another program).
Currently the "export" routine is importing from the spreadsheet, not
exporting to it!
I have tried: running the routine where the spreadsheet exists, spreadsheet
is importing (from target worksheet/fields matched correctly); running the
routine where no spreadsheet exists, no output is produced. No error
messages occur during either run.
Reading from several books and around the web, the code I have appears in-
line with my reading.
Could someone please look over the code and suggest what I might be
missing/need to change?
Export code:
DoCmd.TransferSpreadsheet asExport, _
acSpreadsheetTypeExcel7, _
strTable, _
strWorksheetPath, _
True, _
strWorksheetName
Routine is in Access 2007 on Vista Pro.
Many thanks,
Simon
Ultimately several querys will be exported, each to its own worksheet within
a single workbook.
The workbook does not need to be opened, as no user intervention is required
(eventually the workbook will be used as an import for another program).
Currently the "export" routine is importing from the spreadsheet, not
exporting to it!
I have tried: running the routine where the spreadsheet exists, spreadsheet
is importing (from target worksheet/fields matched correctly); running the
routine where no spreadsheet exists, no output is produced. No error
messages occur during either run.
Reading from several books and around the web, the code I have appears in-
line with my reading.
Could someone please look over the code and suggest what I might be
missing/need to change?
Export code:
DoCmd.TransferSpreadsheet asExport, _
acSpreadsheetTypeExcel7, _
strTable, _
strWorksheetPath, _
True, _
strWorksheetName
Routine is in Access 2007 on Vista Pro.
Many thanks,
Simon