Open Excel with MANUAL calc on

CedarTree

Registered User.
Local time
Today, 12:41
Joined
Mar 2, 2018
Messages
440
Hello,
Trying to open an Excel worksbook from Access, but I don't want Excel to open it up with Automatic Calc mode on. Excel object won't let me set calculation mode to manual or automatic unless I have workbook open. So I open a temporary workbook, set calc mode to manual, then try to open the real workbook. But it still keeps auto calc mode on. Suggestions?

Here's my current code:
Code:
        Set gobjExcel = CreateObject("Excel.Application")
        gobjExcel.Visible = True
        Set gobjBook = gobjExcel.Workbooks.Open("C:\Users\Cedar\Desktop\ManualCalc.xlsx", False, False)
        gobjExcel.Calculation = -4135 'xlManual
        gobjBook.Close
        Set gobjBook = gobjExcel.Workbooks.Open(sFullFileName, False, False)
        Set gobjSheet = gobjBook.ActiveSheet
 
P.S. When I close the temp workbook, I can SEE the calc setting in Excel = automatic or manual. But I can't change it. And it remembers what I set it to if I save the temp Excel file, but as soon as I open the Excel file I'm really interested in, it goes back to Auto calc.
 
I'm not a Excel guy but shouldn't gobjExcel.Calculation relate to with workbook and not the excel object.

mick
 
Leave the manual file open and open your required xl file?
Then close the manual file.

That works, I just tested it. :D
 

Users who are viewing this thread

Back
Top Bottom