Open/Close Problem - Invalid Use of Property


S

Steve in Boston

Hello,

I am trying to manage a custom toolbar in Project 2003, to copy the latest
version into Global MPT on open and to delete it on exit. I don't have
project server or enterprise level mpts.

I am using Project_BeforeClose and Project_Open (below) but it is not
working. I get a compile error "Invalid Use of Property". I have
experimented and can get these subroutines to do a simple msgbox, but will
not perform the actions below nor even run another subroutine embedded in the
MPP when that routine references a project task.

Any help you can offer, or alternatives to this scheme, will be appreciated.
Thank you.

Private Sub Project_BeforeClose(ByVal pj As Project)
OrganizerDeleteItem Type:=6, FileName:="Global.MPT", Name:="XYZ Toolbar"
End Sub

Private Sub Project_Open(ByVal pj As Project)
OrganizerMoveItem Type:=6, FileName:="XYZ Project Plan.mpp",
ToFileName:="Global.MPT", Name:="XYZ Toolbar"
End Sub
 
Ad

Advertisements

S

Steve in Boston

I'd like to amend the question below. The Project_BeforeClose routine does
not work for me, as described. The Project_Open routine does work, however
because the toolbar does not get deleted on close, the user is prompted every
time to replace the toolbar in Global.Mpt, which is a dialogue box I'd rather
my users not see. If there is a way to perform this toolbar copy-and-replace
at open without prompting the user to replace, then that solves part of the
problem - a work around anyways. If there is a better way to manage custom
toolbars, that would be great.
 
J

Jack Dahlgren

You can hide the prompt by setting DisplayAlerts to false

DisplayAlerts = False

Just remember to set it back to true when you are done!

-Jack Dahlgren
 
Ad

Advertisements

S

Steve in Boston

Thank you Jack, you are the best. That works.

I guess error I was getting on Project_BeforeClose is unavoidable and the
proc can't manipulate the MPT at that point. Always copying the toolbar at
open will insure that my users get the latest version.

I would like a way to remove the custom toolbar so it is not sitting there
if another plan is opened, if anyone knows of a way to do this at close.

Thank you.
 

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

Similar Threads


Top