Solved

Auto Run an Excel macro After opening a Workbook

Posted on 1998-09-17
3
900 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction It seems that at least a couple of times per month, I answer a question that requires automating Outlook from another Microsoft Office application, usually (although not always) to send one or more email messages.  For example: …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 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

20 Experts available now in Live!

Get 1:1 Help Now