Can I run a MS Project macro from Excel?

  • Thread starter Thread starter tcolan
  • Start date Start date
T

tcolan

Hello,

Is there a way that I can create a macro in excel that will open and
run a predefined macro in MS Project and then close out of MS project?

Thanks,
Tom
 
If you want to run a Project Macro just add the following
to your Excel code:

Set ProjApp = CreateObject("MSProject.Application")
With ProjApp
.Visible = True
<add your project vba code here.>
.quit
End With
set ProjApp = nothing

All of your project vba code must start with a period
because you are using the projapp object. If you do not
want to see project run, just delete the .visible=true
line above. If you want to run a predefined Project
macro, you should be able to use .run macroname. I have
not used this method, but instead have embedded the
Project code in my Excel code, as above.

This same technique works for all office applications.
Just change the name of the object.
 

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

Back
Top