Event Error in VBA - Do a Calc in a Project Before Save

T

TroyS

I'm new to this so i know i'm asking a straightforward question, but i would
appreciate the help...thx in advance

In a Class Module (named: ILGPMIEvent), i have:
Public WithEvents ILGApp As Application

Private Sub ILGApp_ProjectBeforeSave(ByVal pj As MSProject.Project, ByVal
SaveAsUi As Boolean, Cancel As Boolean)
Application.CalculateProject <-- The debug ends up here....What should
the syntax be ??
End Sub

Under ThisProject I have:
Dim X As New ILGPMIEvent

Private Sub Project_Open(ByVal pj As Project)
Set X.ILGApp = Application
End Sub

Not Sure what the right syntax is to perform an Application.CalculateProject
within the ProjectBeforeSave()....?
My goal was to make sure everything is calculated before Saving so that the
information in ProjectServer is correct. I have some formulas which count up
Tasks based on Conditions.

I'm doing this in the Enterprise Global..

thx
 
R

Rod Gill

I think the before save event should just be:

Private Sub Project_BeforeSave(ByVal pj As Project)

End Sub
 
T

TroyS

I basically have the same structure as noted below, however, when i try to
back up the Enterprise Global, i receive a debug error essentially saying
that this command is not available and the debugger stops as
Application.CalculateProject.

Any ideas on how to get around this failure when trying to back up Ent
Global?
thx.
 

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