Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Switching calculation to manual using Workbook_open

I have a large workbook which takes a while to recalculate, hence one
of my workbook_open macros sets the calculation mode to
xlCalculationManual. However if I already have a workbook open, which
is set to xlCalculationAutomatic, then my large workbook performs a
full calculation before running the workbook_open macros. I can
interupt this by, say, pressing the CAPS LOCK key but whilst I know to
do this other users of this model may not.

Having searched other posts I found only 1 (somewhat cumbersome)
solution which is to open a dummy workbook which contains a macro which
switches calculation mode to manual then opens the large workbook then
closes itself. I am not keen on this idea as it means issuing every
user with 2 files.

I tried replicating my pressing of CAPS LOCK, using the SENDKEYS
command as the first statement in the workbook_open procedure but this
didn't work.

Can anyone help me out? How do I stop the model from calculating upon
opening so that the workbook_open macros run immediately?

TIA

Stuart

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Switching calculation to manual using Workbook_open

I don't think that this will work for the OP.

Stuart's problem with another workbook open (with calculation set to automatic)
isn't addressed. And Stuart says that the recalc occurs before the auto open
macros could run.

(That's the way I remember it, too.)

keepITcool wrote:

Have you tried:

to set the EnableCalculation on the worksheets to False
(in BeforeSave event), then enabling it in workbook_open?

Also a must read is:
http://www.decisionmodels.com/calcsecretsc.htm

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

wrote :

I have a large workbook which takes a while to recalculate, hence one
of my workbook_open macros sets the calculation mode to
xlCalculationManual. However if I already have a workbook open, which
is set to xlCalculationAutomatic, then my large workbook performs a
full calculation before running the workbook_open macros. I can
interupt this by, say, pressing the CAPS LOCK key but whilst I know to
do this other users of this model may not.

Having searched other posts I found only 1 (somewhat cumbersome)
solution which is to open a dummy workbook which contains a macro
which switches calculation mode to manual then opens the large
workbook then closes itself. I am not keen on this idea as it means
issuing every user with 2 files.

I tried replicating my pressing of CAPS LOCK, using the SENDKEYS
command as the first statement in the workbook_open procedure but this
didn't work.

Can anyone help me out? How do I stop the model from calculating upon
opening so that the workbook_open macros run immediately?

TIA

Stuart


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Switching calculation to manual using Workbook_open


the idea was to prevent the workbook calculating
when opened.

but i checked my 'off the cuff' idea and it will not fly:

enablecalculation is NOT saved with the workbook.
thus setting it to false prior to save is useless



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Dave Peterson wrote :

I don't think that this will work for the OP.

Stuart's problem with another workbook open (with calculation set to
automatic) isn't addressed. And Stuart says that the recalc occurs
before the auto open macros could run.

(That's the way I remember it, too.)

keepITcool wrote:

Have you tried:

to set the EnableCalculation on the worksheets to False
(in BeforeSave event), then enabling it in workbook_open?

Also a must read is:
http://www.decisionmodels.com/calcsecretsc.htm

--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam


wrote :

I have a large workbook which takes a while to recalculate, hence
one of my workbook_open macros sets the calculation mode to
xlCalculationManual. However if I already have a workbook open,
which is set to xlCalculationAutomatic, then my large workbook
performs a full calculation before running the workbook_open
macros. I can interupt this by, say, pressing the CAPS LOCK key
but whilst I know to do this other users of this model may not.

Having searched other posts I found only 1 (somewhat cumbersome)
solution which is to open a dummy workbook which contains a macro
which switches calculation mode to manual then opens the large
workbook then closes itself. I am not keen on this idea as it
means issuing every user with 2 files.

I tried replicating my pressing of CAPS LOCK, using the SENDKEYS
command as the first statement in the workbook_open procedure but
this didn't work.

Can anyone help me out? How do I stop the model from calculating
upon opening so that the workbook_open macros run immediately?

TIA

Stuart

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Switching calculation to manual using Workbook_open

Thanks for your input guys. I guess this means it isn't possible. I
can only hope that someone from Microsoft spots these bugs and fixes
them in future versions. I have always thought that the calculation
mode should be a workbook specific setting and not an application
setting. We should be able to have multiple workbooks open each with
different calculation settings.

Stuart



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Switching calculation to manual using Workbook_open

How about as you (KeepItCool) suggest but disabling from the Workbook Open
event, and re-enable when the Auto_Open macros are completed, eg

Sub wsCalc(bFlag As Boolean)
Dim ws As Worksheet
'False from Workbook_open event
'then True from the last Auto_Open macro

For Each ws In Worksheets
ws.EnableCalculation = bFlag
Next

End Sub

Not sure if this'll make any difference but might be worth a try.

Regards,
Peter T


"keepITcool" wrote in message
t.com...

the idea was to prevent the workbook calculating
when opened.

but i checked my 'off the cuff' idea and it will not fly:

enablecalculation is NOT saved with the workbook.
thus setting it to false prior to save is useless



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Dave Peterson wrote :

I don't think that this will work for the OP.

Stuart's problem with another workbook open (with calculation set to
automatic) isn't addressed. And Stuart says that the recalc occurs
before the auto open macros could run.

(That's the way I remember it, too.)

keepITcool wrote:

Have you tried:

to set the EnableCalculation on the worksheets to False
(in BeforeSave event), then enabling it in workbook_open?

Also a must read is:
http://www.decisionmodels.com/calcsecretsc.htm

--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam

wrote :

I have a large workbook which takes a while to recalculate, hence
one of my workbook_open macros sets the calculation mode to
xlCalculationManual. However if I already have a workbook open,
which is set to xlCalculationAutomatic, then my large workbook
performs a full calculation before running the workbook_open
macros. I can interupt this by, say, pressing the CAPS LOCK key
but whilst I know to do this other users of this model may not.

Having searched other posts I found only 1 (somewhat cumbersome)
solution which is to open a dummy workbook which contains a macro
which switches calculation mode to manual then opens the large
workbook then closes itself. I am not keen on this idea as it
means issuing every user with 2 files.

I tried replicating my pressing of CAPS LOCK, using the SENDKEYS
command as the first statement in the workbook_open procedure but
this didn't work.

Can anyone help me out? How do I stop the model from calculating
upon opening so that the workbook_open macros run immediately?

TIA

Stuart



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
Calculation Manual vs Automatic TJAC Excel Discussion (Misc queries) 3 March 4th 08 10:13 PM
Manual Calculation TeresaD Setting up and Configuration of Excel 7 January 28th 08 08:54 PM
Automatic Calculation switching to manual gstevens26 Excel Discussion (Misc queries) 5 August 25th 06 01:58 PM
Calculation set as Manual Dan. Excel Discussion (Misc queries) 1 February 14th 06 04:30 PM
Manual / Automatic Calculation Ray Lau Excel Programming 2 June 29th 04 04:27 PM


All times are GMT +1. The time now is 08:50 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"