Commandbars in MS Project

L

Lee

I have written the code to add a new menu item to MS
Project using Commandbars and a msoControlButton
control. I use the .onAction property to call a macro.

Selection of the macro works fine from this new menu item
in the project where the macro resides. However, the
menu item does not activate the macro from a second
project that I have open (same instance of project).
Selecting the macro manually in the secon project from
the Tools=>Macro... works fine.

Is this a bug in Project or am I doing something wrong.
I have ben using this technique in Excel and never had a
problem.
 
G

Gérard Ducouret

Hello Lee,
Have you tried to stock the VBA procedur in the Global.MPT file :
Tools / Organizer / Modules / ... Copy your module toward the Global.MPT
By the way, you'll have to change the path so that the ControlButton will be
able to find the macro

Gérard Ducouret
 
G

Guest

-----Original Message-----
Hello Lee,
Have you tried to stock the VBA procedur in the Global.MPT file :
Tools / Organizer / Modules / ... Copy your module toward the Global.MPT
By the way, you'll have to change the path so that the ControlButton will be
able to find the macro

Gérard Ducouret

"Lee" <[email protected]> a écrit dans le message de [email protected]...


.

Thank you for the quick response.

Having the procedure in the global.mpt works, however, I
want to steer away from the global.mpt.

I distribute standalone project file that acts as
temporary add-ins, i.e. open the "add-in" file, switch to
user project where the macro is to be run and run the
macro (up until now, manually Tools=>Macros...Run. The
users are on a Windows 2000 network or a standalone and
each essentially has their own global.mpt on sign-on.
Too complicted for each to load the global.mpt from a
project file. Besides, the macro that adds the menu item
shouldn't be in the global.mpt or the menu will be added
every time MS Project is open and that doesn't make it
temporary.

You mentioned changing the path. I have tried every
combination of syntax that I know to get a VBA procedure
to call another procedure in a different project without
having to referenced in the Project. Can you point me to
the correct syntax? Thanks.
 
R

Rod Gill

HI,

I put the code to add a macro button in the Project_Open event and in the
Project_Close event I remove the button.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
-----Original Message-----
Hello Lee,
Have you tried to stock the VBA procedur in the Global.MPT file :
Tools / Organizer / Modules / ... Copy your module toward the Global.MPT
By the way, you'll have to change the path so that the ControlButton will be
able to find the macro

Gérard Ducouret

"Lee" <[email protected]> a écrit dans le message de [email protected]...


.

Thank you for the quick response.

Having the procedure in the global.mpt works, however, I
want to steer away from the global.mpt.

I distribute standalone project file that acts as
temporary add-ins, i.e. open the "add-in" file, switch to
user project where the macro is to be run and run the
macro (up until now, manually Tools=>Macros...Run. The
users are on a Windows 2000 network or a standalone and
each essentially has their own global.mpt on sign-on.
Too complicted for each to load the global.mpt from a
project file. Besides, the macro that adds the menu item
shouldn't be in the global.mpt or the menu will be added
every time MS Project is open and that doesn't make it
temporary.

You mentioned changing the path. I have tried every
combination of syntax that I know to get a VBA procedure
to call another procedure in a different project without
having to referenced in the Project. Can you point me to
the correct syntax? Thanks.
 

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