Open Existing MS Project File

  • Thread starter Thread starter Joe Cletcher
  • Start date Start date
J

Joe Cletcher

It must be simple, but how do I open an existing MS
Project file? I've tried

Dim Proj as MSProject.Project
Proj = CreateObject("MSProject.Application")
Proj.FileOpen("D:\Path\MyExistingProjectFile.mpp")
 
Hi Joe,

And it failed in what way, exactly?

Do you simply want to launch MSProject or do you want control it through
Automation?

Regards,
Fergus
 
When attempting to execute the command

Proj = CreateObject("MSProject.Application")

the following runtime error message was received.

"An unhandled exception of
type 'System.InvalidCastException' occurred in
MyProg.exe. Additional information: Specified cast is not
valid."

I take the error message to mean "MSProject.Application"
is incorrect and another text string is required to
create a Microsoft Project project/application.

Need to know how to create the Microsoft Project object
(whether it is a project or an application) and then open
an existing Microsoft Project file.
 
Found an answer! The following syntax worked:

Dim myProj as MSProject.Project
myProj = GetObject("c:\Test.mpp")
 
Back
Top