Solved

Excel macro

Posted on 2000-05-06
3
325 Views
Last Modified: 2010-05-02
How do you 'kick off' a macro automatically when the excel spreadsheet is opened?
0
Comment
Question by:ff_axel
3 Comments
 
LVL 3

Expert Comment

by:pacificdb
ID: 2784030
Use a macro called "AutoExec".
0
 

Expert Comment

by:stubbs
ID: 2784330
Name the macro Auto_Open

pacificdb: AutoExec is for Word macros that you want to run when you first start Word.
0
 
LVL 44

Accepted Solution

by:
bruintje earned 40 total points
ID: 2785912
in your Excel workbook

open the Code editor with ALT + F11
then insert this code in the thisworkbook object

Private sub Workbook_Open()
  msgbox "opening1"
end sub

or preferable..insert a new module

and insert this code

sub Auto_open()
  msgbox "opening2"
end sub

both will run on the open, but the first is a bit troublesome when debugging code...

HTH:O)Bruintje
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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 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

21 Experts available now in Live!

Get 1:1 Help Now