VBA Toolbar in MS Project Server

M

MichaelA

Hello All,

Has anyone implemented a custom toolbar in MS Project Server (I'm
using 2003) using VBA? Everything works terrific for me in MS Project
standalone and when I install the toolbar in MS Project Server, the
macro doesn't run. The code executes ok from the Editor or from the
Tools/Macro menu. I changed nothing from the standalone version.

I have tried using 'public' to declare the module in case that was an
issue. I have also tried referencing Global.MPT!<procedure name>. It
just won't run from the toolbar.

Any ideas from anyone who has managed to install a toolbar in MS
Project Server?

The relevant toolbar code is:
Set MyButton = MyBar.Controls("Resource %")
If MyButton Is Nothing Then
Set MyButton = MyBar.Controls.Add(Type:=msoControlButton)
With MyButton
.Style = msoButtonIconAndCaption
.FaceId = 183
.Caption = "Resource %"
.TooltipText = "Extracts utilisation of Resources to Excel"
.OnAction = "extractResourceInfo"
'.OnAction="Global.MPT!extractResourceInfo" <= doesn't work
either
End With
End If

The procedure is declared as:
Sub extractResourceInfo ()
<all code here>
End Sub



Thanks and regards
Michael A.
 
J

Jack Dahlgren MVP

First, put the macro in the enterprise global file.
Next make a toolbar in a project which references the macro on the server.
Finally copy the toolbar into the enterprise global using the organizer.

-Jack Dahlgren
 
M

Michael A.

The out take on VBA and toolbars is that what Rod teaches in his book
applies only to MS Project 2003. If you want to create a custom toolbar in
Project Server 2003 or Project 2007, you need to manually create the custom
toolbar, associate the macros, store that toolbar in a template (if for
distribution) and then copy to the (Enterprise) Global template.

Thanks for your advice.

PS. Someone needs to write a more definitive book on VBA for MS Project 2007
such as exists for Excel.
 

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