#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Open Event

Anyone know how to open a work book through code and suppress the any code
that is in the open event of the book being opened?

I know you can do it manually by holding the shift key to go into design
mode so there must be a VBA equivalent mustn't there?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Open Event

Hi Andy

Use EnableEvents

Sub test()
Application.EnableEvents = False
Workbooks.Open "C:\Data\test1.xls"
Application.EnableEvents = True
End Sub


Or put your code in this sub

Sub Auto_open()

End Sub

Must be in a normal module
If you use a Auto_open macro then this wil not run if you open the file with a macro



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Andy" wrote in message ...
Anyone know how to open a work book through code and suppress the any code
that is in the open event of the book being opened?

I know you can do it manually by holding the shift key to go into design
mode so there must be a VBA equivalent mustn't there?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Open Event

Thanks Ron

Andy



"Ron de Bruin" wrote:

Hi Andy

Use EnableEvents

Sub test()
Application.EnableEvents = False
Workbooks.Open "C:\Data\test1.xls"
Application.EnableEvents = True
End Sub


Or put your code in this sub

Sub Auto_open()

End Sub

Must be in a normal module
If you use a Auto_open macro then this wil not run if you open the file with a macro



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Andy" wrote in message ...
Anyone know how to open a work book through code and suppress the any code
that is in the open event of the book being opened?

I know you can do it manually by holding the shift key to go into design
mode so there must be a VBA equivalent mustn't there?




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
Open Event jlclyde Excel Discussion (Misc queries) 5 September 17th 08 09:18 PM
Workbook Open Event Steve Excel Programming 1 September 22nd 04 06:47 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM
Workbook Open Event Stuart[_5_] Excel Programming 1 July 6th 04 08:47 PM
Open event Cindy Excel Programming 2 February 10th 04 05:33 PM


All times are GMT +1. The time now is 01:04 AM.

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

About Us

"It's about Microsoft Excel"