Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Start up Macro (2003)

    Hi,
    I want a macro to run automatically when I open a project file. How can I do that?
    Thanks,
    Deb

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Start up Macro (2003)

    You can create a macro named Auto_Open in a standard module, or an event procedure called Project_Open in the ThisProject module.
    If you do this in a specific project, the code will run automatically when you open that project.
    If you store it in Global.mpt, the code will run whenever you open a project.

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Start up Macro (2003)

    Thank you . This helped, but I now have another issue. I am unable to create a macro in my resource pool file. When I attempt to record a macro and store it in "This Project" I get an error after clicking on OK in the Record Macro dialog box. The error is:

    ************************************************** ************************************************** ***
    "Macro" is not a valid name.

    A macro name must begin with a letter and can contain letters, numbers, and the underscore character. It cannot contain spaces or be a word that Project reserves as a keyword. A macro name aslo cannot be longer than 128 characters in length.
    ************************************************** ************************************************** ***

    I get this error no matter what name I try.

    I also tried to create it with the VB editor, but the This Project object does not exist to add a module to. Only "Project Global (Global.MPT)" is displayed.

    I don't want to add the macro to the global template, I only want it to run in this project. Any ideas why I can't add it to a resource pool file? Is this not supported for some reason?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •