PRJ: GetObject Opens MPP Read-Only If Class Is Specified (152777)
The information in this article applies to:
- Microsoft Project 98 for Windows
- Microsoft Project for Windows 95 4.1
- Microsoft Project for Windows 95 4.1a
- Microsoft Project for Windows 4.0
- Microsoft Project for the Macintosh 4.0
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:
Modification Type: | Major | Last Reviewed: | 11/25/2003 |
---|
Keywords: | kbprb KB152777 |
---|
|