Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Opening a file and disabling open events

Hi All
I have a an application (workbook) running some VBA code, I want this code
to open another application (workbook) but prevent its open events being
fired to prevent the opened workbook VBA code running.

How do I do this?

Cheers




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Opening a file and disabling open events

Nigel,

Something like the following should work. You'll probably want to add some
error checking.

Dim WB As Workbook
Application.EnableEvents = False
Set WB = Workbooks.Open("C:\Book1.xls")
Application.EnableEvents = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Nigel RS" wrote in message
...
Hi All
I have a an application (workbook) running some VBA code, I want this code
to open another application (workbook) but prevent its open events being
fired to prevent the opened workbook VBA code running.

How do I do this?

Cheers






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Opening a file and disabling open events

Thanks Chip, works a dream!

"Chip Pearson" wrote:

Nigel,

Something like the following should work. You'll probably want to add some
error checking.

Dim WB As Workbook
Application.EnableEvents = False
Set WB = Workbooks.Open("C:\Book1.xls")
Application.EnableEvents = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Nigel RS" wrote in message
...
Hi All
I have a an application (workbook) running some VBA code, I want this code
to open another application (workbook) but prevent its open events being
fired to prevent the opened workbook VBA code running.

How do I do this?

Cheers







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
Disabling Events: Dangerous? JakeyC Excel Programming 1 October 26th 05 10:12 PM
Disabling Events Patrick Simonds Excel Programming 3 October 5th 05 12:35 PM
disabling linked object before you open a file totoro Excel Discussion (Misc queries) 4 August 12th 05 06:11 PM
Prevent user disabling events JP Farrow Excel Programming 1 September 29th 04 04:49 PM
Disabling Events MWE[_28_] Excel Programming 4 February 6th 04 05:39 AM


All times are GMT +1. The time now is 01:58 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"