Link to home
Start Free TrialLog in
Avatar of vtang
vtang

asked on

Auto Run an Excel macro After opening a Workbook

Need to run a macro automatically after opening an Excel 97 Workbook.

Any suggestion?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of shalbe
shalbe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shalbe
shalbe

vtang,

In Excel97 another way to do it is to go to the Visual Basic editor.

Double click on ThisWorkbook on the left side.

In the top left hand dropdown, where it says (General), select Workbook.

The event listed in the right hand drop down should default to Open and a macro called Workbook_Open will be created.

This subroutine will also autorun when the workbook is opened. Workbook_Open is the new method in Excel97. Auto_Open is from earlier versions but still works fine.

Steve
Also something to be aware of that there is a registered Microsioft Bug with running more than one Auto_Open Macro from code. ie If you are opening sevberal books and are exectuing their Auto_Open macros, only the first one will be executed.

Regs

Steve