Magnatolia
New member
- Local time
- Tomorrow, 00:11
- Joined
- Sep 19, 2014
- Messages
- 1
Hi all,
I know nothing about VBA for Access but I created a drag-and-drop macro for exporting which didn't do what I wanted so I converted it to VBA.
What I want to achieve is have a list of queries that all export into one existing spreadsheet with the query name as the sheet name. So each query will have it's own sheet. I believe TransferSpreadsheet is the appropriate command.
I have '
I know nothing about VBA for Access but I created a drag-and-drop macro for exporting which didn't do what I wanted so I converted it to VBA.
What I want to achieve is have a list of queries that all export into one existing spreadsheet with the query name as the sheet name. So each query will have it's own sheet. I believe TransferSpreadsheet is the appropriate command.
I have '
Code:
Call DoCmd.TransferSpreadsheet (TransferType:=acExport, TableName[I]:="QueryName[/I]", FileName[I]:="Spreadsheet location and name[/I]")
[I]Call DoCmd.TransferSpreadsheet (TransferType:=acExport, TableName[I]:="QueryName2[/I]", FileName[I]:="Spreadsheet location and name[/I]")
Call DoCmd.TransferSpreadsheet (TransferType:=acExport, TableName[I]:="QueryName3[/I]", FileName[I]:="Spreadsheet location and name[/I]")
[/I][I][/[/I]CODE]
The first two queries work correctly, however everything after these two claim that the object doesn't exist, but I have checked and triple-checked the spelling, and even pasted the exact query name but no luck.
Am I doing something wrong?
Thanks!