ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing Calculation Method (https://www.excelbanter.com/excel-programming/283648-changing-calculation-method.html)

Simon Palmer

Changing Calculation Method
 
I set up a user form to control user inputs into a complex workbook. On closing the form a range of inputs are pasted into the book, but because the calculation method is set to Automatic, excel re-calculates the sheet after each value is pasted

When I tried to switch off automatic recalculation in code I get a run-time error which I didn't expect. I used

Application.Calculation = xlCalculationManua

but get the error

Run Time Error 1004 - Method 'Calculation' of object '_Application' faile

Any suggestions as to what causes this and how I can fix it ?

Charles Williams

Changing Calculation Method
 
Hi Simon,

one method is to move the Application.calculation to the main module:

Application.Calculation = xlCalculationManual
frmMyForm.show
PasteVals
Application.Calculation = xlCalculationAutomatic


Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com

"Simon Palmer" wrote in message
...
I set up a user form to control user inputs into a complex workbook. On

closing the form a range of inputs are pasted into the book, but because the
calculation method is set to Automatic, excel re-calculates the sheet after
each value is pasted.

When I tried to switch off automatic recalculation in code I get a

run-time error which I didn't expect. I used :

Application.Calculation = xlCalculationManual

but get the error :

Run Time Error 1004 - Method 'Calculation' of object '_Application' failed

Any suggestions as to what causes this and how I can fix it ?




simon

Changing Calculation Method
 
Thanks


All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com