Run project macro from other Office application

G

Guest

Hello,

I'm trying to make let a project macro run from ms
access. I didn't came so far as to let it run but I
started with the following code: Is this the correct way
to let the macro run?

Dim Exec As String
Dim Proj As String
Dim Ok As Double
Dim toPass As String

Exec = "C:\Program Files\Microsoft Office\"_
"Office10\WINPROJ.EXE"
Proj = "file.mpp"
toPass = Exec & Proj
Ok = Shell(toPass, vbHide)
SendKeys ""

Although I'm sure my path is correct, the project can't
be opened.

Help would be greatly appreciated,

Kind regards,

Kristof
 
V

Vadim Roulnov

Hi,

That is the way I use from Excel:

Dim pj As Object
Set pj = CreateObject("MSProject.Project")
pj.Application.FileOpen "file.mpp"

-Vadim
 

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