Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Button on toolbar for AutoCalc

Hello All,

I have a button on a custom toolbar to change the settings of the
calculation mode of Excel (ToolsOptions...Calculation
TabCalculation Settings):

Sub ToggleAutoCalc()
If Application.Calculation = xlCalculationAutomatic Then
Application.Calculation = xlCalculationManual
Application.CalculateBeforeSave = False
Else
Application.Calculation = xlCalculationAutomatic
Application.CalculateBeforeSave = True
End If

End Sub

The problem I am having is that my button doesn't tell me if it is on
or off (the Name property of the button is set to "Toggle AutoCalc").
I want to change it to read "AutoCalc On" and "AutoCalc Off". I can
figure out the code to change the text displayed, but I also want to
check the status of the settings each time a new file is opened (I
open Excel in the morning and try to leave it open the whole day,
opening and closing several files throughout the day).

Which event procedure should I put this in? There isn't an
"Application" project object in the Project Explorer. Should it go in
"Personal.xls"? If so, which event procedure does it need to go in so
it will check each time a different file is opened?

Thanks for any help anyone can provide,

Conan Kelly


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Button on toolbar for AutoCalc

You would need to use Application level events. Chip Pearson discusses them
he

http://www.cpearson.com/excel/AppEvent.htm

and his download contains an example of using the Application Workbook Open
event, which is the one you would want to use.

--
Jim
"Conan Kelly" <CTBarbarin at msn dot com wrote in message
...
| Hello All,
|
| I have a button on a custom toolbar to change the settings of the
| calculation mode of Excel (ToolsOptions...Calculation
| TabCalculation Settings):
|
| Sub ToggleAutoCalc()
| If Application.Calculation = xlCalculationAutomatic Then
| Application.Calculation = xlCalculationManual
| Application.CalculateBeforeSave = False
| Else
| Application.Calculation = xlCalculationAutomatic
| Application.CalculateBeforeSave = True
| End If
|
| End Sub
|
| The problem I am having is that my button doesn't tell me if it is on
| or off (the Name property of the button is set to "Toggle AutoCalc").
| I want to change it to read "AutoCalc On" and "AutoCalc Off". I can
| figure out the code to change the text displayed, but I also want to
| check the status of the settings each time a new file is opened (I
| open Excel in the morning and try to leave it open the whole day,
| opening and closing several files throughout the day).
|
| Which event procedure should I put this in? There isn't an
| "Application" project object in the Project Explorer. Should it go in
| "Personal.xls"? If so, which event procedure does it need to go in so
| it will check each time a different file is opened?
|
| Thanks for any help anyone can provide,
|
| Conan Kelly
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Button on toolbar for AutoCalc

Jim Rech (and Chip Pearson),

Thank you so much for all of your help. This is exactly what I was
looking for. It worked perfectly.

Thanks again,

Conan Kelly




"Jim Rech" wrote in message
...
You would need to use Application level events. Chip Pearson
discusses them
he

http://www.cpearson.com/excel/AppEvent.htm

and his download contains an example of using the Application
Workbook Open
event, which is the one you would want to use.

--
Jim
"Conan Kelly" <CTBarbarin at msn dot com wrote in message
...
| Hello All,
|
| I have a button on a custom toolbar to change the settings of the
| calculation mode of Excel (ToolsOptions...Calculation
| TabCalculation Settings):
|
| Sub ToggleAutoCalc()
| If Application.Calculation = xlCalculationAutomatic Then
| Application.Calculation = xlCalculationManual
| Application.CalculateBeforeSave = False
| Else
| Application.Calculation = xlCalculationAutomatic
| Application.CalculateBeforeSave = True
| End If
|
| End Sub
|
| The problem I am having is that my button doesn't tell me if it is
on
| or off (the Name property of the button is set to "Toggle
AutoCalc").
| I want to change it to read "AutoCalc On" and "AutoCalc Off". I
can
| figure out the code to change the text displayed, but I also want
to
| check the status of the settings each time a new file is opened (I
| open Excel in the morning and try to leave it open the whole day,
| opening and closing several files throughout the day).
|
| Which event procedure should I put this in? There isn't an
| "Application" project object in the Project Explorer. Should it
go in
| "Personal.xls"? If so, which event procedure does it need to go
in so
| it will check each time a different file is opened?
|
| Thanks for any help anyone can provide,
|
| Conan Kelly
|
|




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
toolbar button Dennis S. Excel Discussion (Misc queries) 5 July 9th 08 03:52 AM
New button on toolbar attaboy Excel Worksheet Functions 5 January 23rd 07 04:17 PM
button on toolbar tango Excel Programming 2 October 21st 04 08:46 AM
Delete a custom button by holding down the ALT key and dragging the button off the toolbar Stephen[_8_] Excel Programming 0 April 4th 04 02:22 PM
Toolbar Button Gary Chan Excel Programming 4 August 21st 03 09:20 PM


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