Running macro on Open

E

ETLahrs

I have a workbook in which 2 of the worksheets are filled with external data
from 2 separate text files. The workbook will be utilized daily and the text
files will also be updated daily. To keep the data current, I have the
refresh on the data as everytime the workbook is opened. I also have 3
macros that extract/analyze the data from the text files.

I had set the 3 macros to run on the open of the workbook, however they run
before the data is updated from the text files. Is there a way to refresh
the data first, then have th macros run?

Thanks for the help.
Ed
 
B

Bernie Deitrick

Ed,

You can schedule those three macros to run after opening by using the Application.OnTime method in
the autoopen macro/ open event.

HTH,
Bernie
MS Excel MVP
 
E

ETLahrs

Thanks. That will work. The only other idea I came up with was doing
Selection.QueryTable.Refresh BackgroundQuery:=False
before the macros.

Thanks Again.
 

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