DoCmd.OutputTo: Store path location selected by user to a string

kapaw

Registered User.
Local time
Today, 09:54
Joined
Mar 30, 2011
Messages
30
I am using this code
DoCmd.OutputTo acOutputReport, "rptFilter", "Excel97-Excel2003Workbook(*.xls)", strFilename, True, "", , acExportQualityScreen
with the OutputFile set to "" so the user can select the directory on where they want to store the exported template. My issue is I'm trying to figure out if I could get the file path and the file name and store it on a string so I could use it for something else.
 
At the simplest level you could prompt the user to enter the details

Code:
strFileName = InputBox("What is the output file")
 
What about the directory on which the user will store it? I want to be able to store that in a string too including the filename
 
strFileName = InputBox("What is the output file", "Enter path and file name", "C:\your directory\your file name.xlsx")
 

Users who are viewing this thread

Back
Top Bottom