I am Generating a New Sheets using macros. For a New Sheet generation , Data is retrieved from more than 4 MS Access DB. Each DB had minimum 200 field. My Macro code includes
You can try the usual vba optimization methods of setting calculation to manual and disabling ScreenUpdating.
Dim calc As XlCalculation
calc = Application.Calculation
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = True
Application.Calculation = calc
Put your code or function call between Application.Calculation = xlCalculationManual
and Application.ScreenUpdating = True
.
This is from my previous Post
Note: I coundn't find info weather or not you run the code from within Access or Excel. If you create the Excel Workbook from Access you probably have some code like this:
Dim xlApp As Excel.Application
Set xlApp = new Excel.Application
In this case you would have to change Application
in the code above to xlApp
. For example:
xlApp.Calculation = xlCalculationManual