I have a similar performance issue to that in slow exporting from access to excel, exporting data to MS Excel by setting individual cell values looping on:
objSheet.Cells(table_1_row_no + intcounter, table_1_colA_col_no) = table_1_array(intcounter, 0)
however my data comes from an array, and needs to be processed in excel after transfering it there, hence i need to have an open sheet to work with after transfering the data. As a result non of the methods noted in the above post appear ideally suited.
I have an MS access application that pulls data from the database does a fair bit of processing of the data in vba prior to it being put into excel. As a result the data to be transfered is in array rather than a recordset. The simplest way to get it back to a recordset to allow the .CopyFromRecordset method to be used, is to create a temporary table and recordset, but this seams a fairly lengthy path to go down unless theres nothing better.
The spreadsheet does a lengthy calculation before Access picks a result back. I'm keen to leave this in excel as this gives flaxibility for engineer's using it to make adjustments where needed for differant situations (the environment is controlled so unauthorised changes arent a concern). As a result options that simply drop out a csv, or an excel file without opening it aren't suited either.
Any suggestions much appreciated.
objSheet.Cells(table_1_row_no, table_1_colA_col_no).resize(numRows,1).Value = yourArrayHere
– Tim Williams