Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Auto Run an Excel macro After opening a Workbook

Posted on 1998-09-17
3
Medium Priority
?
909 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
shalbe earned 400 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

730 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