Article ID: 152777
Article Last Modified on 1/19/2007
APPLIES TO
- Microsoft Project 98 Standard Edition
- Microsoft Project 4.1 Standard Edition
- Microsoft Project 4.1a
- Microsoft Project 4.0 Standard Edition
- Microsoft Project 4.0 for Macintosh
This article was previously published under Q152777
SYMPTOMS
When using Microsoft Project as the OLE server in an OLE Automation
session, the GetObject method may unintentionally open an existing project
file as read-only if the following conditions are true:
The project file name (optionally preceded with the file path)
is specified in the pathname argument.
-and-
The class argument is specified ("MSProject.Project")
WORKAROUND
When specifying an existing project file while using GetObject, omit the
class argument. The Class argument is redundant because the class can be
deducted from the file specified, and Microsoft Project is the only
application that is registered with Project files.
For example instead of the following
Set oProjFile = GetObject("C:\TEST.MPP" , "MSProject.Project")
use the following code:
Set oProjFile = GetObject("C:\TEST.MPP")
STATUS
Microsoft has confirmed this to be a problem in the products listed at the
beginning of this article.
REFERENCES
"Introduction to Visual Basic for Applications, Project Edition," version
4.0, Module 3, Lesson 3: OLE Automation
For more information about the GetObject property in Microsoft Project
version 4.1, click Answer Wizard on the Help menu and type:
For more information about GetObject in Microsoft Project version
4.0, choose the Search button in Visual Basic Reference Help and type:
Additional query words: 4.10a
Keywords: kbprb KB152777