As in "without saving the results in a temporary table"? Sure. Any of the
methods like TransferSpreadsheet or TransferText can use a query rather than
a table.
This command can be used repeatedly for any number of sheets in an Excel
workbook. I have included the method for including the date the file was
saved.
If the queries need to be saved then can you suggest a way to view the
queries without opening the database window, so that the user can delete the
query after being exported. I am trying to protect the database by avoiding
the user having access to the database window.
That will raise an error 3265 ("Item not found in this collection") if the
named query doesn't actually exist, so you might want to add error handling
for that case.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.