Link to home
Start Free TrialLog in
Avatar of Greg989
Greg989

asked on

MSAccess How to prompt in export to Excel VBA statement

Capricorn1 gave me the answer for VBA code to export a query to Excel.  Now I'd like to know how to make that query prompt for file name rather than hard-coded as in his answer: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
"queryName", "C:\myQuery.xls", True, ""
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Greg989
Greg989

ASKER

That is helpful for future reference but what I'd really like to emulate is what happens when you run an OutputTo macro where the file name is left blank.  In that case you are presented the windows "Save As" dialogue screen defaulting to MyDocuments.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Greg989

ASKER

Thanks... It appears this will work.  Regardless, it most likely will serve me well for future reference.  Since it is fairly complex, relative to my puny mind, I think I'll just "RunMacro" instead and leave the file name blank as mentioned in my original question.  Thanks!