Buck Beasom
asked on
How do I set Excel Calculation Options to Manual from code using Late Binding.
I have Excel workbooks with lots of formulas in them that I populate from Access Code. All the workbook templates are set to "Manual Calculation" but if the user has another Excel workbook open that is set to Automatic, the template switches to Automatic when it opens.
Is there a way to set it back to Manual before starting the populating? When it's manual, the program runs MUCH slower.
Thanks.
Is there a way to set it back to Manual before starting the populating? When it's manual, the program runs MUCH slower.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In my experience, "xl" commands that would be generated by recording an Excel Macro do not function when using late binding. I will try "objExcel.Calculation = -4135, as I have successfully used some other "-4###" to minimize an open Excel application once it is loaded. Will let you know the results.
Thanks.
Thanks.
ASKER
Worked perfectly.
Thanks.
Thanks.
If it is possible ask the users to go to Formulas and set the calculations to Manual for this file.
Excel will use the setting of the 1st opened file in a session. Hence, one option is to code to open a dummy excel in manual mode and through it open, your excel file. This way your excel will take the manual settings of the opened dummy file.
try the below by opening a macro and pasting the below code and if it dont help then you need to do the above
Private Sub Workbook_Open()
Application.Calculation = xlManual
End Sub