I am trying to export a query to .xlsx and I have the file in mydocuments and I get cannot find file error. Do I need to not name the file and just allow the end-user to select the file name instead?
Here is my code:
Maybe I should be doing this?
Here is my code:
Code:
Private Sub cmdExcel_Click()
DoCmd.OutputTo acOutputQuery, "qryA", acFormatXLSX, "C:\qryA.xlsx", , , , acExportQualityPrint
End Sub
Maybe I should be doing this?
Code:
Private Sub cmdExcel_Click()
DoCmd.OutputTo acOutputQuery, "qryA", acFormatXLSX, "C:\.xlsx", , , , acExportQualityPrint
End Sub