Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Manual Calculate for Excel Workbook

Hi All,

I have Excel 2003 and am trying to get a workbook not to auto-calculate.

The workbook is opened through a button on the menu bar. In the procedure I
set Application.Calculation = xlCalculationManual, then open the workbook.
In the workbook's Deactivate event I set Application.Calculation =
xlCalculationAutomatic and in the Activate event I set it back to
xlCalculationManual. However, when the I set the Calculation in the
Deactivate event the workbook I don't want to be calculated is calculated.

Next I tried to use the workbook's Protect method with an empty password.
Again, the workbook calculates in the Deactivate event.

Anyone have any ideas on how a workbook can be set not to auto-calculate
while leaving the others on auto-calculate?

Thanks

Ed


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Manual Calculate for Excel Workbook


I've figured it out, without having to use the workbook events.

Public Sub OpenNoCalculate()
Dim wk As Workbook, ws As Worksheet
Dim calcSetting As XlCalculation
Dim calcB4SaveSetting As Boolean

calcSetting = Application.Calculation
calcB4SaveSetting = Application.CalculateBeforeSave

Application.Calculation = xlCalculationManual
Application.CalculateBeforeSave = False

Set wb = Workbooks.Open(Filename:="file")

For Each ws In wb.Worksheets
ws.EnableCalculation = False
Next ws

Application.Calculation = calcSetting
Application.CalculateBeforeSave = calcB4SaveSetting

End Sub

Thanks anyway,

Edmund

"Edmund" wrote in message
...
Hi All,

I have Excel 2003 and am trying to get a workbook not to auto-calculate.

The workbook is opened through a button on the menu bar. In the procedure
I set Application.Calculation = xlCalculationManual, then open the
workbook. In the workbook's Deactivate event I set Application.Calculation
= xlCalculationAutomatic and in the Activate event I set it back to
xlCalculationManual. However, when the I set the Calculation in the
Deactivate event the workbook I don't want to be calculated is calculated.

Next I tried to use the workbook's Protect method with an empty password.
Again, the workbook calculates in the Deactivate event.

Anyone have any ideas on how a workbook can be set not to auto-calculate
while leaving the others on auto-calculate?

Thanks

Ed




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Calculate Keeps Resetting to Manual Shirley Excel Worksheet Functions 2 April 14th 10 04:58 PM
Manual Calculation in Excel 2007 with Calculate mode set to Automatic Julie White Excel Worksheet Functions 1 November 24th 09 09:38 PM
Help!Excel will not calculate formulas- Not in manual calculation Lisa Excel Worksheet Functions 6 December 9th 08 12:47 PM
manual calculate Adam Excel Discussion (Misc queries) 5 April 12th 08 12:45 AM
why would calculate change from automatic to manual on its own? sandy Excel Discussion (Misc queries) 2 September 29th 05 03:04 PM


All times are GMT +1. The time now is 09:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"