Solved

Auto Run an Excel macro After opening a Workbook

Posted on 1998-09-17
3
901 Views
Last Modified: 2012-06-27
Need to run a macro automatically after opening an Excel 97 Workbook.

Any suggestion?

Thanks
0
Comment
Question by:vtang
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
shalbe earned 100 total points
ID: 1613688
vtang,

Name the macro Auto_Open.

This will automatically run the macro when you open the workbook.

Steve
0
 
LVL 3

Expert Comment

by:shalbe
ID: 1613689
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
0
 

Expert Comment

by:rauchs
ID: 1613690
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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now