Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Simon,
No, what I am saying is that if you don't trap errors, and the code bombs nosily, or even exits quietly, it won't get to your code that resets events to True. This is an example of how I handle it in the worksheet_change event, but this is only an example, it may not be appropriate for your code Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then With Target 'do your stuff End With End If ws_exit: Application.EnableEvents = True End Sub The aim is to9 always make it set the events to true. -- HTH RP (remove nothere from the email address if mailing direct) "Simon Shaw" <simonATsimonstoolsDOTcom wrote in message ... Hi Bob, Thanks, I did set it to true at the end of my procedure. However, is there something I should be aware of during the execution procedures while enableevents is set to false? Are you saying that error trapping occurs differently if it is set to false? "Bob Phillips" wrote: But make sure that you reset them afterwards, or you will get odd things happening. That means catering for any errors in your macro to reset them. -- HTH RP (remove nothere from the email address if mailing direct) "galimi" wrote in message ... Simon, You can disable Sheet/Workbook events with the following command application.enableevents=false http://HelpExcel.com "Simon Shaw" wrote: Hi, Can I stop the event macro assigned to a sheet: Private Sub Worksheet_Change(ByVal Target As Range) 'details end sub while other macros act on the sheet? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
suspend auto increment | Excel Discussion (Misc queries) | |||
Suspend window while Excel VBA macro is executing | Excel Programming | |||
Suspend code | Excel Programming | |||
Screen suspend | Excel Programming | |||
Suspend/resume running of a macro | Excel Programming |