LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 188
Default Reverting User Session to Automatic Calculation


Hi All,

I have a user model that includes code to switch the user session to
Manual Calculation during use.

I am using two event procedures at the Workbook level to ensure that
this is still the case before the user saves the workbook (for the
next user who might disable macros, but still won't want automatic
calcs on):

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

With Application
.Calculation = xlManual
.CalculateBeforeSave = False
End With

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

With Application
.Calculation = xlManual
.CalculateBeforeSave = True
End With

End Sub


Problem:

This leaves the user session set to manual calculation. If they close
down Excel, and re-open then it resets to automatic calculation, but
if they had two models open including this one, then the manual
calculation setting endures through the session.

I next tried making it manual before save (as above), but resetting to
automatic before close.

However, contrary to what I had expected, Excel appears to close
first, and then save (?)

Is there any other way that I can make the model save without
calculating first, but then revert to automatic calculation? I guess
that I need an event After Save, but the only candidate seems to be
the Close event, which *appears* to occur before saving if I am right.

Any suggestions are most welcome.

Thanks,

Alan.


 
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
Automatic Calculation Hawkfan757 Excel Worksheet Functions 1 March 7th 07 11:01 PM
Startup and template locations in Citrix TS session and local session John Nurick Setting up and Configuration of Excel 2 September 21st 06 10:42 PM
Formula needed - automatically calculate session time totals for each user optimusprym8 Excel Worksheet Functions 2 June 22nd 06 02:01 PM
Automatic calculation reverting to manual depending upon who opens Pablito Excel Discussion (Misc queries) 1 August 11th 05 02:54 AM
Automatic calculation of user-defined worksheet function Bart Deschoolmeester Excel Programming 2 October 8th 03 04:37 PM


All times are GMT +1. The time now is 11:11 AM.

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

About Us

"It's about Microsoft Excel"