how to auto run a macro?

  • Thread starter Porfirio Fuentes Martínez
  • Start date
P

Porfirio Fuentes Martínez

I need to execute a Macro when I open a project, how can I do it?
Thanks

Porfirio Fuentes
 
J

Jack D.

Porfirio said:
I need to execute a Macro when I open a project, how can I do it?
Thanks

Porfirio Fuentes

Open Project
Hit ALT+F11
In the box in the upper left expand the project so it shows "Microsoft
Project Objects"
Double click on "This Project (name of your project.mpp)
In the code window that opens enter:

Private Sub Project_Open(ByVal pj As Project)
MsgBox "Project Just Opened"
End Sub

You can replace the MsgBox code with whatever you want to happen when you
open the project.


--
Please try to keep replies in this group. I do check e-mail, but only
infrequently. For Macros and other things check http://masamiki.com/project

-Jack Dahlgren, Project MVP
email: J -at- eM Vee Pee S dot COM


+++++++++++++++++++
 
P

Porfirio Fuentes Martínez

It worked fine!! Thanks!!


Jack D. said:
Open Project
Hit ALT+F11
In the box in the upper left expand the project so it shows "Microsoft
Project Objects"
Double click on "This Project (name of your project.mpp)
In the code window that opens enter:

Private Sub Project_Open(ByVal pj As Project)
MsgBox "Project Just Opened"
End Sub

You can replace the MsgBox code with whatever you want to happen when you
open the project.


--
Please try to keep replies in this group. I do check e-mail, but only
infrequently. For Macros and other things check http://masamiki.com/project

-Jack Dahlgren, Project MVP
email: J -at- eM Vee Pee S dot COM


+++++++++++++++++++
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top