Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable SelectionChange Event BillCPA Excel Discussion (Misc queries) 2 February 17th 06 06:45 PM
Disable Auto_Open with VBA wrkoch[_3_] Excel Programming 7 September 3rd 04 08:36 PM
how to disable listbox change event Tom Ogilvy Excel Programming 0 July 27th 04 05:55 PM
Excel 2004 Can't Disable Auto_Open Macro. What Now? SidBord Excel Programming 4 July 9th 04 08:09 PM
Disable Change Event in Form No Name Excel Programming 5 October 31st 03 08:23 PM


All times are GMT +1. The time now is 02:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"