Running macro on Open

  • Thread starter Thread starter ETLahrs
  • Start date Start date
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
 
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
 
Thanks. That will work. The only other idea I came up with was doing
Selection.QueryTable.Refresh BackgroundQuery:=False
before the macros.

Thanks Again.
 
Back
Top