Programming in the Project_Open Event

D

Dustin Ventin

The long story goes like this:

My client wants a report that displays a variety of data from a group of MSP
projects all saved in an MDB file, including the Baseline Created date.
However, because the Baseline Created date is not saved in the Access tables,
I need to find another way of accessing it. I tried opening each MSP project
individually and adding the report, but because of the great number of
projects involved this is too slow of a solution.

I've struck upon another idea...I want to add a field to the database to
hold the Baseline Created date (we already have dozens of custom tables
already). Then I would write a macro that will save the Baseline Created
date into this field whenever a certain event goes off. Now, I'm trying to
start simple and just have a messagebox appear when the program opens:

Private Sub Project_Open(ByVal pj As Project)
msgbox("This is a test!")
End Sub

However, nothing happens. I've tried this same code in multiple projects on
multiple computers. I've even checked out some web sites about writing this
kind of code, and it all looks like it should be this simple.

Short story goes like this:

How do I get code to run in the Project_Open event?

Thank you,

Dustin
 
J

Jack Dahlgren

What are the security settings? Go to tools menu / options / security tab /
macro security button / set to low.

-Jack
 
D

Dustin Ventin

Yes, that worked perfectly, thank you (although it's embarassing I didn't
catch that).

Now I have the code I need, but I need to propigate it across ALL the
projects in the database. Is there a way to do this without copy/paste? We
have a template that all the projects are based off of, and I placed the code
there... however, it did not seem to retroactively update all the projects
that had been based upon it. Is there a way for me to place this macro
(which runs on the Project_Close event) in all the projects in an mdb file at
once?

Thank you again,

Dustin
 

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