Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I know Excel has an "On Error" function, but is there such a thing as
On Break or On Reset or On Quit or something of that sort? My code changes Excel's Calculation to Manual and changes it back to Automatic at the end. There's also an On Error function that changes it back to Automatic if there's an error in the code. But sometimes I step through my code and hit Reset, and in this case the Calculation stays in Manual mode. Is there a way I can change it back to Automatic when I hit Ctrl+Break or Reset? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nope... When you interupt the code you need to manually restore the settings.
-- HTH... Jim Thomlinson "Chris" wrote: I know Excel has an "On Error" function, but is there such a thing as On Break or On Reset or On Quit or something of that sort? My code changes Excel's Calculation to Manual and changes it back to Automatic at the end. There's also an On Error function that changes it back to Automatic if there's an error in the code. But sometimes I step through my code and hit Reset, and in this case the Calculation stays in Manual mode. Is there a way I can change it back to Automatic when I hit Ctrl+Break or Reset? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No, but you can execute the command from the Immediate window.. i.e., enter
this in the command window and then press enter application.Calculation=xlCalculationAutomatic -- Hope that helps. Vergel Adriano "Chris" wrote: I know Excel has an "On Error" function, but is there such a thing as On Break or On Reset or On Quit or something of that sort? My code changes Excel's Calculation to Manual and changes it back to Automatic at the end. There's also an On Error function that changes it back to Automatic if there's an error in the code. But sometimes I step through my code and hit Reset, and in this case the Calculation stays in Manual mode. Is there a way I can change it back to Automatic when I hit Ctrl+Break or Reset? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Aug 7, 11:32 am, Vergel Adriano
wrote: No, but you can execute the command from the Immediate window.. i.e., enter this in the command window and then press enter application.Calculation=xlCalculationAutomatic -- Hope that helps. Vergel Adriano "Chris" wrote: I know Excel has an "On Error" function, but is there such a thing as On Break or On Reset or On Quit or something of that sort? My code changes Excel's Calculation to Manual and changes it back to Automatic at the end. There's also an On Error function that changes it back to Automatic if there's an error in the code. But sometimes I step through my code and hit Reset, and in this case the Calculation stays in Manual mode. Is there a way I can change it back to Automatic when I hit Ctrl+Break or Reset? Thanks for the help, guys. I think I'll take Vergel's advice and create a comment stating that if the code doesn't run all the way through, run <application.Calculation=xlCalculationAutomatic in the Immediate window. It's crude, but it should get the job done. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can have your code look for a ctrl-break.
Check out application.EnableCancelKey in VBA's help. This won't help you if you hit the Reset button, though. Chris wrote: I know Excel has an "On Error" function, but is there such a thing as On Break or On Reset or On Quit or something of that sort? My code changes Excel's Calculation to Manual and changes it back to Automatic at the end. There's also an On Error function that changes it back to Automatic if there's an error in the code. But sometimes I step through my code and hit Reset, and in this case the Calculation stays in Manual mode. Is there a way I can change it back to Automatic when I hit Ctrl+Break or Reset? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
What is Error "Method "Paste" of object "_Worksheet" failed? | Excel Programming |