Hello everyone,
I would like to export my query to excel, and I grab the below code, sorry i don't remember the owner..
-------
-------
But it pops up a Run-time error '2302': Cant save the output data to the file you've selected.
Can someone please examine the code and fix the error..
Thank you
I would like to export my query to excel, and I grab the below code, sorry i don't remember the owner..
-------
Code:
Dim filepath As String
Dim FileName As String
filepath = Environ("userprofile") & "\Desktop\qryCrosstab_Payment"
FileName = filepath & "as of" & Format(Date, "mm.dd.yy") & ".xlsx"
DoCmd.OutputTo acOutputQuery, "qryCrosstab_Payment", acFormatXLSX, FileName, , , , acExportQualityPrint
But it pops up a Run-time error '2302': Cant save the output data to the file you've selected.
Can someone please examine the code and fix the error..
Thank you
Last edited by a moderator: