Referring to other workbooks

G

Guest

I have several (okay, about 500) different sheets to open, extract data, drop
it into another workbook, and close.

I've tried simply using references to the workbooks in the cells. Problem is

a) takes WAY too long to update and
b) those 500 files come out at about 31 per month - that is, in January,
there are 31 files, February, another 31 files.

I want to drop the data in each month to minimize the refresh time.

BUT, the sheets (the data entry sheets) are very complex and have
Workbook_Open and _Close and Sheet_Deactivate macros that I want to prevent
from firing when the data is downloaded. Mostly just so I can speed things up.

Any ideas?

Thanks all.
 
D

Dave Peterson

If you want to avoid running any events when you open another workbook, you can
disable them:

dim wkbk as workbook
application.enableevents = false
set wkbk = workbooks.open (filename:=xxxxx)
'do the copy/paste/move/consolidate
wkbk.close savechanges:=false
application.enableevents = true
'not sure when .enableevents = true should be turned on if you need it for
'anything your code does
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top