Home Image-Pro Plus Automation with Macros
Options

Disabling Excel automatic calculation

(Originally posted by James Katerberg on 11/4/2005)

In an ImagePro macro, I open an Excel workbook template into which data is placed. The workbook contains a large number of equations. I would like to turn off automatic calculation before opening the workbook as it can take a up to a minute before all the calculations are complete. Currently I am opening the Excel workbook using the following commands

Set oExcel = CreateObject ("Excel.Application") ' Create Excel application object
Set xlWorkbook = oExcel.Workbooks.Open (xlPath)

I have tried the following
Set oExcel = CreateObject ("Excel.Application") ' Create Excel application object
oExcel.calculation=x1manual
Set xlWorkbook = oExcel.Workbooks.Open (xlPath)

but I get the error message saying "Expecting an Existing scalar var.

I have tried the following
Set oExcel = CreateObject ("Excel.Application") ' Create Excel application object
oExcel.calculation="x1manual"
Set xlWorkbook = oExcel.Workbooks.Open (xlPath)

but I get the error message saying "(&H800a03ec) Unable to set the Calculation property of the Application Class"

How do I turn off the automatic calculation and later turn it back on from within an ImagePro macro?

Comments

  • Options

    (Originally posted by Chris Tully on 11/18/2005)

    oExcel.calculation=xlmanual

    Should also work. Notice xl versus x1.

     

Sign In or Register to comment.