Dear readers,
I have a query generating from 100 to 80.000 records, even more
The problem is that the performance is low when trying to export the data to Excel, even if the number of records is low
I have tried several test, but I do not see a big difference in performance.
Is there anybody who knows a better solution
-----------
Test 1
Set qdf = CurrentDb.QueryDefs(“qry_test”)
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, qdf.Name, "O:\test.xlsx"
-----------
Test 2
DoCmd.OutputTo acOutputQuery, “qry_test”, acFormatXLS, _
"O:\test.xlsx", True
-----------
Test 3
Set objExcelApp = CreateObject("Excel.Application")
Set objworkbook = objExcelApp.Workbooks.Open("o:\2template.xlsx")
objExcelApp.Application.Visible = True
'Set objExcelWrkBk1 = objExcelApp.Workbooks.Add
Set rst = Me.frm_SubForm.Form.Recordset
Set rng = objworkbook.Worksheets("Data").Range("A2")
rng.CopyFromRecordset rst
-----------
Test 4
When executing the recordset to the subform, you can export this via the menu, external data, export to excel,
-----------
Many thanks
Ben
I have a query generating from 100 to 80.000 records, even more
The problem is that the performance is low when trying to export the data to Excel, even if the number of records is low
I have tried several test, but I do not see a big difference in performance.
Is there anybody who knows a better solution
-----------
Test 1
Set qdf = CurrentDb.QueryDefs(“qry_test”)
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, qdf.Name, "O:\test.xlsx"
-----------
Test 2
DoCmd.OutputTo acOutputQuery, “qry_test”, acFormatXLS, _
"O:\test.xlsx", True
-----------
Test 3
Set objExcelApp = CreateObject("Excel.Application")
Set objworkbook = objExcelApp.Workbooks.Open("o:\2template.xlsx")
objExcelApp.Application.Visible = True
'Set objExcelWrkBk1 = objExcelApp.Workbooks.Add
Set rst = Me.frm_SubForm.Form.Recordset
Set rng = objworkbook.Worksheets("Data").Range("A2")
rng.CopyFromRecordset rst
-----------
Test 4
When executing the recordset to the subform, you can export this via the menu, external data, export to excel,
-----------
Many thanks
Ben