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

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.EnableEvents = False
With Application
.Calculation = xlManual
.CalculateBeforeSave = True
End With
ThisWorkbook.Save
With Application
.Calculation = xlAutomatic
.CalculateBeforeSave = True
End With
ThisWorkbook.Saved = True
Application.EnableEvents = True
End Sub

I think what Don is telling you is that when you open your workbook, it
doesn't make any difference what setting it was saved with unless it is the
first workbook opened. If you want to have a specific setting for the
workbook, you need to set that in the workbook_open event. However, it is
not clear what you want when it is opened - the above will handle the
situation of leaving the application with automatic calculation after the
workbook is closes while saving it with calculation set to manual - as you
described. The beforesave event is not involved.

--
Regards,
Tom Ogilvy





Alan wrote in message
...
"Don Guillett" wrote in message
...

Excel takes calculation mode from the first workbook opened.


Okay, but I am forcing the calculation mode via VBA, so how do I force
it back again *after* the save event?

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 06:15 PM.

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"