Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
EnableEvents
Hi all,
EnableEvents = false and EnableEvents = true need to be paired ? Similiar issue are ScreenUpdating,DisplayAlerts. Clara -- thank you so much for your help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
EnableEvents
Hi Clara
EnableEvents = false and EnableEvents = true need to be paired ? Similiar issue are ScreenUpdating,DisplayAlerts. Normally, yes! More generally, changes which are made to application settings should normally be reversed by your code when no longer required. It is often therefore, advisable to restore application settings to their previous state in an error handler; in this way any error in the code will not prevent the desired restoration of the previous settings. An example might be: '================ Public Sub Tester() Dim CalcMode As Long On Error GoTo XIT With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With 'Your code XIT: With Application .Calculation = CalcMode .ScreenUpdating = True End With End Sub '<<================ --- Regards, Norman |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
EnableEvents
Hi Norman, thank you very much!
Clara -- thank you so much for your help "Norman Jones" wrote: Hi Clara EnableEvents = false and EnableEvents = true need to be paired ? Similiar issue are ScreenUpdating,DisplayAlerts. Normally, yes! More generally, changes which are made to application settings should normally be reversed by your code when no longer required. It is often therefore, advisable to restore application settings to their previous state in an error handler; in this way any error in the code will not prevent the desired restoration of the previous settings. An example might be: '================ Public Sub Tester() Dim CalcMode As Long On Error GoTo XIT With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With 'Your code XIT: With Application .Calculation = CalcMode .ScreenUpdating = True End With End Sub '<<================ --- Regards, Norman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
EnableEvents doesn't work | Excel Programming | |||
Application.EnableEvents | Excel Programming | |||
Application.EnableEvents help | Excel Programming | |||
EnableEvents BeforeClose | Excel Programming | |||
application.EnableEvents | Excel Discussion (Misc queries) |