running a macro in project

S

Steff

Next question... I know this is basic but...

I created a userform with a button to create and save a document...

Now I want to tie it to a macro button on the toolbar in the main project
but I can't seem to get the userform in the vba editor to a spot where the
main program can see it to tie it to a button... this seem very basic but I
am missing something.. any words of advice are welcome....
 
M

MSP Project Version via Macro

Steff,

I had the same problem, I am sure there are other ways to do this, but
here is how I did it.

I right clicked on the smart icon bar and then selected customize. Once I
got to the Customize panel I clicked the Commands tab, then selected New Menu
from the Categories list. Then I did a drag and drop from the Commands list
of the New Menu item and droped it on the action bar. I could then edit it
and name it what ever I wanted. At that point I had my ned menu drop down and
just needed to add my Macro to it. So I wen t back to the Customize->Commands
and selected All Macros from the Categories list. I them did a drag and drop
of my Macro to the new menu item on the action bar. At that point you can
give it a title and add cute little icons to it.

I hope this helps.

David
 
S

Steff

Hmmm... nope... the problem I have is that after I have created the macro...
it does not show up in the list of All Macros. So nothing there to drag and
drop. thanks though.
 
M

MSP Project Version via Macro

Steff,

OK, yep had that same problem too. I created a user form and you are right
they don't show up on the macro selection. In the VB window, I had to create
a "Module" that called a function in the user form before it would show in
the macro list. Have included sample code below.

Sub Show_Audit_Form()
'Procedure Shows Audit Form
' Shortcut: CONTROL + M

frmAudit.Show

End Sub

Does that help?

David
 
S

Steff

Hmmmmm... generates a runtime error 424, object required...

I typed :

Sub Show_Pac_Create_Form()
'Procedure Shows Audit Form

frmPacCreate.Show

End Sub

Am I supposed to refer to the userform as the object I am calling in the
function or do I place another object in the userform that the function calls
to? I know I am dense but I find it hard to believe I am the first person to
ever try to use a user form in Project...
 
J

Jack Dahlgren

Should work. Where is the userform stored? In the project or the global? How
about the macro?
 
S

Steff

Found the problem! Whoo woo... I was being stupid... College was simply too
long ago... thanks for the help though..

Could it be a missing reference?
 

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