Customised toolbar viewing over a network

Z

zip

Hi,

I have developed a project file with a macro that runs automatically when
the file is opened as below,

Private Sub Project_Open(ByVal pj As Project)
' Macro Autorun
Macro "Toolbars"
End Sub

This auto run macro moves a customised toolbar from the global.mpt to the
project file.mpp so that this toolbar can be used over a network for this
particular project file.

My problem is that whenever a user who has previously opened my file opens
another project file on their networked desktop, these toolbars are loaded
and visible.

I would somehow like to ensure that these toolbars are only loaded and
visible for my particular project file. I have thought about a macro that
runs automatically when the user closes this file but I am have not been
successful doing this.

Any help would be greatly appreciated. Thanks very much...
 
G

Gérard Ducouret

Hi Zip,

Use the BeforeClose event to remove or delete your tool bar:
Private Sub Project_BeforeClose(ByVal pj As Project)

Hope this helps,

Gérard Ducouret
 
J

John

zip said:
Hi,

I have developed a project file with a macro that runs automatically when
the file is opened as below,

Private Sub Project_Open(ByVal pj As Project)
' Macro Autorun
Macro "Toolbars"
End Sub

This auto run macro moves a customised toolbar from the global.mpt to the
project file.mpp so that this toolbar can be used over a network for this
particular project file.

My problem is that whenever a user who has previously opened my file opens
another project file on their networked desktop, these toolbars are loaded
and visible.

I would somehow like to ensure that these toolbars are only loaded and
visible for my particular project file. I have thought about a macro that
runs automatically when the user closes this file but I am have not been
successful doing this.

Any help would be greatly appreciated. Thanks very much...

zip,
The problem is that custom toolbars do not "appear" because they are in
a specific file, rather they appear because they are in the user's
Global. And since they are in the user's Global, they will of course
always appear whenever that user opens any project file.

I think your approach of using a Close Event macro to remove the custom
toolbar from the Global is your best bet. It should basically be the
reverse of your Open Even macro.

John
Project MVP
 

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