View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default Opening workbook with OpenEvent

Many thanks

--
Cheers
Nigel



"Dave Peterson" wrote in message
...
Disable events for as long as you need to:


dim wkbk as workbook
application.enableevents = false
set wkbk = workbooks.open(filename:=...., updatelinks:=???)
'do anything you want
wkbk.close savechanges:=false
application.enableevents = true

If you re-enable events, you could get workbook_beforeclose and

worksheet_change
events to fire (which could be a good thing if you want them to fire).

Nigel wrote:

Hi All
I have a number of workbooks I wish to extract data from, the extract
routine is in another control workbook that opens each in sequence

copies
the data into the control book. My problem is that each of the

workbooks I
am opening contains a workbook_open event that loads a userform. (Excel

97).
How do I either prevent the workbook open event happening or close the
userform in the newly opened workbook so that I can copy data and then

close
it?

--
Cheers
Nigel


--

Dave Peterson