How to call a VBA procedure in the Enterprise Globale

N

Newbie

Hello,

A BeforeSave event triggered another sub in another Module in Project
Standard. Everything worked fine.
I imported the main module in the Enterprise Globale, (The BeforeSave event
is still staying in the published file : ThisProject module) but now the
BeforeSave macro doesn't find the other macro in the Enterprise Globale :
"Compilation Error, Sub or Function not defined".
How to call a VBA procedure in the Enterprise Globale ?
Thanks for help,

Newbie
 
G

Guest

Hello Newbie,

Open the enterprise global and put your Project_BeforeClose code in the
ThisProject object.

Bob Segrest, PMP
Microsoft Project Blackbelt
 
N

Newbie

Hello Bob,

Thanks for this answer.
Another question: How can I efficiently edit a VBA macro which is in the
Enterprise Global: Each time I try to do that, I save the Enterprise
Global...and I lose every change when I reopen the Enterprise Global ????

Newbie
 
G

Guest

Hi Newbie,

First of all I'm glad to help. It helps me stay on my toes and is little
enough payback for all those who helped me. And if you really get
stuck, I do this for a living... ;^)

After you update the enterprise global, you need to exit all the way out
of Microsoft Project and start it again on your system. This is because
Microsoft Project (on your workstation) only load the global on startup.

Try this and tell me if you are still loosing your changes.

Bob Segrest, PMP
Microsoft Project Blackbelt
 
N

Newbie

Hi Bob,
Thanks again!

You said: "exit all the way out of Microsoft Project and start it again on
your system".
That's what I did, and all my changes were lost.
The only way I succeeded do make a change in the Enterprise Global module is
to do it in a published project module, then to copy this module (via the
Organizer) into the Enterprise Global.

Newbie
 
G

Guest

Ok, let's review just to be sure we are in sync...

Start Microsoft Project on your workstation.
Select Tools | Enterprise Options | Open Enterprise Global.
Push the Alt-F11 keys to launch VBA.
Select and Expand the VBAProject (Checked-out Enterprise Global)

If you want to add code that will be triggered by a project event
( BeforeSave for example ) put your code in the ThisProject area.

If you want to add a VBA macro, create a module under VBAProject
(Checked-out Enterprise Global) and put your VBA code in it.

When you are done, go back to Microsoft Project save the open
Enterprise Global project and close Microsoft Project completely.

Now start Microsoft Project again and push Alt-F11 to launch VBA.
This time open VBAProject (Global(+ cached Enterprise)).
You should find whatever you add to your global earlier here...

Is this what you are doing?

If not, what did I miss?

Bob Segrest, PMP
Microsoft Project Blackbelt
 
N

Newbie

Hi Bob,
That's exactly what I did (5 times), step by step, but eventually all my
changes were lost.
Thanks for taking my issue in account.

Newbie
 
E

Ed Morrison

Newbie,
Backup your Enterprise Global!!!!
Open up the Enterprise Global (Tools, Enterprise Options, Open Enterprise
Global).
Then go to the coding window.
Select by double clicking the "ThisProject (global###)" where ### is the
rest of the global file's name. It is under VBAProject (global###) and
Microsoft Project Objects.
Enter your code.
Save it.
Close the coding window.
Save the Enterprise Global.
Exit Project Pro.
Open Project Pro.
Go to the coding window. You should see your code in the ThisProject (Global
(+ non-cached Enterprise)).

Hope this helps.
--
Ed Morrison
msProjectExperts
"We wrote the books on Project Server"
http://www.msprojectexperts.com
FAQ - http://www.projectserverexperts.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