PaquettePaul
Member
- Local time
- Today, 15:30
- Joined
- Mar 28, 2022
- Messages
- 107
I have a configuration field which identifies the path where pdf reports are to be stored. I join the path, a file name, and a pdf extension, use the OutputTo command and it works as expected behind the scene.
However, when I try to do the same with Excel, it rejects the request. If I leave out the file parameter, the OS asks for the file name and location. But it stores the excel spreadsheet without problem. gblQt is constant equal to “
stFileName = "Flight Time Summary By Date"
gblText = gblQt & gblDirectoryPath & "\" & stFileName & ".xlsx" & gblQt
MsgBox gblText
DoCmd.OutputTo acOutputQuery, "xclACFlightMinQ", acFormatXLSX, gblText
The message I get back is:
Microsoft Access can't save the output data to the file selected
i put the msg box code in to check the contents of the string, but it appears the same as when I do a pdf report.
An6 thoughts?
However, when I try to do the same with Excel, it rejects the request. If I leave out the file parameter, the OS asks for the file name and location. But it stores the excel spreadsheet without problem. gblQt is constant equal to “
stFileName = "Flight Time Summary By Date"
gblText = gblQt & gblDirectoryPath & "\" & stFileName & ".xlsx" & gblQt
MsgBox gblText
DoCmd.OutputTo acOutputQuery, "xclACFlightMinQ", acFormatXLSX, gblText
The message I get back is:
Microsoft Access can't save the output data to the file selected
i put the msg box code in to check the contents of the string, but it appears the same as when I do a pdf report.
An6 thoughts?