View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Alan Moseley Alan Moseley is offline
external usenet poster
 
Posts: 75
Default Overriding the calculation state

Charles

Many thanks for replying. I had seen this option but was a little wary of
using it. I guess that you are suggesting that I use it in the workbook_open
event. When the workbook opens I currently store the user's
Application.Calculation setting. If it is automatic then I also change it to
manual. In the workbook_close event I am then setting
Application.Calculation setting back to the value store during the
workbook_open event. This way I am not affecting the user's underlying
wishes about the calculation mode. Can I do something similar with the
CalculateBeforeSave setting? If so, in which event would I set it back to
it's original setting? Is it Before_Close? Would setting it back at this
point not initial a calculation?

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"Charles Williams" wrote:

Application.CalculateBeforeSave=False

Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"Alan Moseley" wrote in message
...
Hi all. Hope someone can help.

I have a workbook with custom functions which fetch data via odbc from a
database. I have disabled auto calculation when opening the workbook as I
wish to control the order in which the workbook is calculated, which is:-

1. Calulate worksheet 1
2. Sort the data based upon the result of some calculations
3. Calculate worksheet 2
4. Sort the data based upon the result of some calculations
5. And so on until the last worksheet is processed.

The user would then print as necessary, save the workbook, and then close
it. My problem is that after the sort has been completed, Excel considers
that the workbook needs calculating again, even though I do not need it
to.
When the user saves the workbook, as the calculation state is now pending,
Excel now calculates (which takes some considerable time) before saving.
Can
I override this pending state in some way? If not, what other possible
solutions are available to me?

Thanks in advance. A gold star for the best answer!

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.