TransferSpreadsheet

fanfan2

Registered User.
Local time
Today, 08:11
Joined
Feb 26, 2007
Messages
61
I exported the db with the TransferSpreadsheet method, seems like I have to specify the file path when writing the code.

Is there a way that the user can be prompt to choose the file path where to save the file?

thanks very much.
 
You can write code to pop the Explorer window where the user can select the path.
Save the user's chosen path in a variable then pass it to transfer spreadsheet.

Here is a link to a sample showing how to save a file to a specific directory.
http://www.rogersaccesslibrary.com/forum/topic277.html

Have a look on 'Rogers access library'. It has heaps of sample databases, including export to excel. If you don't find exactly what you're looking for, you will get enough information to write the code yourself.
 
Q&D:
Code:
docmd.transferspreadsheet acExport, acspreadsheettypeexcel12, "query1", inputbox("Please enter filename", "Export to Excel")
HTH:D
 
Q&D:
Code:
docmd.transferspreadsheet acExport, acspreadsheettypeexcel12, "query1", inputbox("Please enter filename", "Export to Excel")
HTH:D

I tried this but don't know where the saved file is...how can the user choose the path where to save the file? thanks.
 
Jeanette Cunningham already gave you the answer. Just follow the link.
I gave you an alternative.
 

Users who are viewing this thread

Back
Top Bottom