ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable event macro while Auto_open() run (https://www.excelbanter.com/excel-programming/333327-disable-event-macro-while-auto_open-run.html)

Sunil Patel

Disable event macro while Auto_open() run
 
New at this so discription may be wrong


Is it possible to disable an event macro (Macro in sheet 1) while Auto_Open
macro (in module) is running.
i.e excel file is opening.

one way might be to check which macro triggered the event macro. !!!

Sunil



STEVE BELL

Disable event macro while Auto_open() run
 
The easiest way is to surround your code with this:

Sub xxx()
Application.EnableEvents = False

' your code in here


Application.EnableEvents = True
End Sub


--
steveB

Remove "AYN" from email to respond
"Sunil Patel" wrote in message
...
New at this so discription may be wrong


Is it possible to disable an event macro (Macro in sheet 1) while
Auto_Open macro (in module) is running.
i.e excel file is opening.

one way might be to check which macro triggered the event macro. !!!

Sunil




Tom Ogilvy

Disable event macro while Auto_open() run
 
Sub Auto_Open()
On Error goto ErrHandler
Application.EnableEvents = False
' current code

ErrorHandler:
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy


"Sunil Patel" wrote in message
...
New at this so discription may be wrong


Is it possible to disable an event macro (Macro in sheet 1) while

Auto_Open
macro (in module) is running.
i.e excel file is opening.

one way might be to check which macro triggered the event macro. !!!

Sunil






All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com