A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
You might be able to do it this way - both macros have a button to execute them. The MsgBox statements are just for example purposes.
'made Public so that the Start/Stop macros can be
'in separate code modules if needed/desired.
Public StopThisNonsense As Boolean
Sub StartInfiniteLoop()
MsgBox "Starting Loop"
StopThisNonsense = False
Do Until StopThisNonsense
DoEvents ' need this to recognize other events like button-click!
Loop
End Sub
Sub MyOtherMacro()
'best to have a button to run this macro also!!
StopThisNonsense = True ' stop that perpetual loop in Workbook_Open()
'do more stuff here
MsgBox "Loop Halted"
End Sub