AutoRun

  • Thread starter Thread starter Usen
  • Start date Start date
U

Usen

Hi,

I have a worksheet that loads automatically (Xlstart folder), but hidden.

There is a few macros in it, but what I want to acheive is when I open a
file I want a macro to execute, but I don't know where to put it.

It doesn't work on the workbook_open sub, since this one starts only when
the initial file loads.

Thanks.
 
If you want code to run when *any* workbook is opened, you need to use
application-level events, specifically the App_WorkbookOpen event (for
opening existing workbooks) and/or the App_NewWorkbook event (when a new
workbook is created). See http://www.cpearson.com/excel/AppEvent.aspx for
details and example code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
Thanks, it works great.


Chip Pearson said:
If you want code to run when *any* workbook is opened, you need to use
application-level events, specifically the App_WorkbookOpen event (for
opening existing workbooks) and/or the App_NewWorkbook event (when a new
workbook is created). See http://www.cpearson.com/excel/AppEvent.aspx for
details and example code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

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

Back
Top