Packaging macros

D

dew

Is it possible to package macros for distribution to others as an add in like
in Excel? Or is there another way to distribute macros?

Thanks,

dew
 
M

Mike Glen

Hi Dew,

Welcome to this Microsoft Project newsgroup :)

A way is for you to use Tools/Organizer.../Modules tab to copy the macro to
GLOBAL>MPT. Then create a new project and copy the macro to that through
the Organizer. Send this new project to all and get them to copy back to
their own GLOBAL.MPTs. If you're all on the same server, you need only to
copy it to the server's GLOBAL.MPT.

FAQs, companion products and other useful Project information can be seen at
this web address: <http://www.mvps.org/project/>

Hope this helps - please let us know how you get on :))

Mike Glen
MS Project MVP
 
D

dew

Thanks Mike. That seems a little easier than asking them to import it to
global.mpt. I'll test it on a couple of users.

dew
 
J

JackD

In addition, you can turn on the macro recorder and capture the actions of
using the organizer to move the modules. Then edit the code and put it in a
blank project. Set the Project_Open event to run this code

Private Sub Project_Open(ByVal pj As Project)
'your code here
MsgBox "foo"
End Sub

Note that the code for Project_Open goes in a different place than an
ordinary module
Open the VBA editor (ALT+F11)
In the Project Explorer window, find the current project, expand it to see
"Microsoft Project Objects" and then the ThisProject object. Double click on
that and a code window will open. Write the code there. You can just refer
to a macro in a module. So if you wrote a macro called MoveStuffToGlobal
then the code in the Project_Open section would say

Private Sub Project_Open(ByVal pj As Project)
MoveStuffToGlobal
End Sub
 
D

dew

Neat idea! Thanks.

JackD said:
In addition, you can turn on the macro recorder and capture the actions of
using the organizer to move the modules. Then edit the code and put it in a
blank project. Set the Project_Open event to run this code

Private Sub Project_Open(ByVal pj As Project)
'your code here
MsgBox "foo"
End Sub

Note that the code for Project_Open goes in a different place than an
ordinary module
Open the VBA editor (ALT+F11)
In the Project Explorer window, find the current project, expand it to see
"Microsoft Project Objects" and then the ThisProject object. Double click on
that and a code window will open. Write the code there. You can just refer
to a macro in a module. So if you wrote a macro called MoveStuffToGlobal
then the code in the Project_Open section would say

Private Sub Project_Open(ByVal pj As Project)
MoveStuffToGlobal
End Sub

--
-Jack ... For project information and macro examples visit
http://masamiki.com/project

..
 
D

dew

Below is my macro to run on opening Project. It won't run, however. It runs
just fine as a sub that isn't private. I can't see what's wrong.

Thanks.


Private Sub Project_Open(ByVal pj As Project)

'Install copy macro

OrganizerMoveItem Type:=3, FileName:="Install2.mpp",
ToFileName:="Global.MPT", Name:="CopyToExcel"

'AddMenuButton

Set cstmExcel = CommandBars("Menu Bar").Controls _
.Add(Type:=msoControlPopup, Before:=11)

With cstmExcel
.Caption = "&CopyToExcel"
.OnAction = "Macro ""CopyToExcel"
End With

End Sub
 

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