L
Lee
I am trying to output a query to Excel and save it. Here
is the code I am using:
DoCmd.OutputTo acOutputQuery, "qrydatamrg", acFormatXLS,
Application.CurrentProject.Path & "Tally.xls", False
The code works, but I expected it to save in the same
folder as the database, but it saves in the next level
folder. In other words, if my application is located at
"c:\test\test name," it saves the spreadsheet in "test"
folder rather than "test name" folder. It also adds the
name of the folder where it is located, so instead of a
spreadsheet named "Tally.xls" which is what I want, I end
up with something like "test name Tally.xls".
What am I doing wrong?
is the code I am using:
DoCmd.OutputTo acOutputQuery, "qrydatamrg", acFormatXLS,
Application.CurrentProject.Path & "Tally.xls", False
The code works, but I expected it to save in the same
folder as the database, but it saves in the next level
folder. In other words, if my application is located at
"c:\test\test name," it saves the spreadsheet in "test"
folder rather than "test name" folder. It also adds the
name of the folder where it is located, so instead of a
spreadsheet named "Tally.xls" which is what I want, I end
up with something like "test name Tally.xls".
What am I doing wrong?