PC Review


Reply
Thread Tools Rate Thread

Check if workbook is open...

 
 
John
Guest
Posts: n/a
 
      10th Jun 2008
I have a workbook that runs a macro when it open. I have a second workbook
that needs to open the first workbook and import data. How do I prevent the
opening macro from running when the other workbook opens it?

Using Excel 2003

Thanks in advance!
 
Reply With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      10th Jun 2008
put your open code in a standard module called Auto_Open. it will only run when
the workbook is opened manually not via code.

if you have your code in a workbook_open module, it will fire whether the
workbook is opened manually or via code.

--


Gary


"John" <(E-Mail Removed)> wrote in message
news:6D874CDB-6DA5-404F-A436-(E-Mail Removed)...
>I have a workbook that runs a macro when it open. I have a second workbook
> that needs to open the first workbook and import data. How do I prevent the
> opening macro from running when the other workbook opens it?
>
> Using Excel 2003
>
> Thanks in advance!



 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      10th Jun 2008
hi
disable events.

Application.EnableEvents = False
Workbooks.Open Filename:= _
"C:\my\file\path\FileWithOnOpenMacro.xls"
Application.EnableEvents = True

this should disable the on open macro.
regards
FSt1

"John" wrote:

> I have a workbook that runs a macro when it open. I have a second workbook
> that needs to open the first workbook and import data. How do I prevent the
> opening macro from running when the other workbook opens it?
>
> Using Excel 2003
>
> Thanks in advance!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to check is someone else has a workbook open Jim K. Microsoft Excel Misc 2 29th Aug 2008 04:32 PM
Check for open workbook =?Utf-8?B?T2xkamF5?= Microsoft Excel Programming 3 17th Apr 2008 11:09 AM
If Then to check if a workbook is open =?Utf-8?B?U2hhd24=?= Microsoft Excel Misc 5 25th Nov 2006 04:29 PM
How check if workbook open? =?Utf-8?B?SWFuIEVsbGlvdHQ=?= Microsoft Excel Programming 7 14th Apr 2006 08:54 PM
Check for open workbook georgio Microsoft Excel Programming 2 20th Nov 2004 11:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:33 AM.