LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro in 2nd Open workbook

You can disable events before you open the second workbook to prevent the
workbook_open from firing:

Dim wkbk1 as workbook
dim wkbk2 as workbook

set wkbk1 = workbooks.open(filename:=....)

application.enableevents = false
set wkbk2 = workbooks.open(filename:=....)
application.enableevents = true

Depending on what you're doing, you may want to turn off events before you do
anything with that second workbook to keep all events from firing in that
workbook.

Steve wrote:

Is it possible to open Workbook1 with macros allowed but then open Workbook2,
from within Workbook1, but with macros disabled? I really only am trying to
copy data from Workbook2 to Workbook1 and don't need the "Open workbook"
macro to run in Workbook2. It just really slows down the copy process


--

Dave Peterson
 
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 Workbook Macro??? Supe Excel Discussion (Misc queries) 2 December 19th 07 08:37 PM
Run a macro when I open a workbook CraigJ Excel Discussion (Misc queries) 1 June 13th 07 04:04 PM
How to Run Macro in open workbook/s hni Excel Discussion (Misc queries) 1 October 31st 05 10:14 AM
run macro on workbook open kevin Excel Discussion (Misc queries) 3 March 4th 05 10:12 AM
how can I run a macro when I open a workbook? filo666 Excel Discussion (Misc queries) 2 March 2nd 05 07:56 PM


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