Last post Feb 17, 2016 06:44 AM by Yohann Lu
Feb 16, 2016 02:05 PM|sinhaify|LINK
How to export (microsoft access .mdb query having user defined function) to excel ??
Feb 17, 2016 06:44 AM|Yohann Lu|LINK
From your description, You have a query and export the results to a specific workbook in a saved Excel workbook. So, as far as I know, you can VBA to export access select queries to excel files.
The following code for your reference:
Private Sub ExportExcel()
Dim i As Integer
Dim myQueryName As String
Dim myExportFileName As String
For i = 1 To 3
myQueryName = "GBQuery" & Format(i, "00")
myExportFileName = "C:\Users\Gary\Documents\GBQuery" & Format(i, "00") & ".xlsx"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, myQueryName, myExportFileName, True
More information about DoCmd.TransferSpreadsheet Method (Access):