View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected][_2_] thesquirrel@gmail.com[_2_] is offline
external usenet poster
 
Posts: 39
Default How to Stop VBA from executing

I have had this problem as well recently and I solved it by doing
this...

debug.assert 1 = 2

Adding this as the first line in your Auto_Open and it will break on
its own each time its run.

Hope that helps.

theSquirrel



JMB wrote:
My impression is it was an autoopen macro. Depending on how long it takes
the macro to run, I think there may not be enough time.

Personally, I keep a button on my toolbar to toggle events on/off
Sub ToggleEvents()
With Application
.EnableEvents = Not .EnableEvents
If .EnableEvents Then
.StatusBar = False
Else: .StatusBar = "Events Are Disabled"
End If
End With
End Sub

But the OP could also set security to medium or high prior to opening the
workbook.

"Les Stout" wrote:

JMB, You can also press ctrl/break(Pause) to stop the code.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***