D
Daniel
Hello,
I am testing the BeforeSave event in a very simple way and I got an error.
Here is the code:
Public Sub Project_BeforeSave(ByVal pj As MSProject.Project)
MsgBox pj.Name
End Sub
If I click on the save menu, I get the message, then I click on close and on
exit and everything is fine.
But if I click directly on close (some users can do that!), I get the close
dialogue box, then I keep “close†checked and click save. Then, I get the
message:
An unexpected error occurred with the method.
Looking at it on debug, it seems that the pj object exists, but all the
properties got the values: “An unexpected error etc.â€
It is like if the project has been closed before executing the macro! So
what’s wrong?
I am testing the BeforeSave event in a very simple way and I got an error.
Here is the code:
Public Sub Project_BeforeSave(ByVal pj As MSProject.Project)
MsgBox pj.Name
End Sub
If I click on the save menu, I get the message, then I click on close and on
exit and everything is fine.
But if I click directly on close (some users can do that!), I get the close
dialogue box, then I keep “close†checked and click save. Then, I get the
message:
An unexpected error occurred with the method.
Looking at it on debug, it seems that the pj object exists, but all the
properties got the values: “An unexpected error etc.â€
It is like if the project has been closed before executing the macro! So
what’s wrong?