PRJ: Can't Select OLE Object Using Visual Basic Macro Command

Last reviewed: November 24, 1997
Article ID: Q126670
The information in this article applies to:
  • Microsoft Project 98 for Windows
  • Microsoft Project for Windows 95, versions 4.1, 4.1a
  • Microsoft Project for Windows, version 4.0
  • Microsoft Project for the Macintosh, version 4.0

SYMPTOMS

In a macro in Microsoft Project, you cannot select a specific OLE object, such as the third object in your project, using a Visual Basic command.

CAUSE

You cannot select a specific OLE object using the Visual Basic macro language in Microsoft Project because the OLE object is not exposed in the object model in Microsoft Project. In a Visual Basic procedure in Microsoft Excel, you can select or activate a specific OLE object using the OLEObjects object or the OLEObjects method. For example, to select the third object on a worksheet, you can use the following command:

   ActiveSheet.OLEObjects(3)

Note that you can use the ObjectConvert or the ObjectChangeIcon method with a selected object in Microsoft Project. Additionally, you can use the ObjectInsert method to display the Insert Object dialog box.

MORE INFORMATION

To view the objects exposed by Microsoft Project, do the following:

  1. From the Help menu, choose Contents.

  2. Select the Visual Basic Reference topic.

  3. Under Programming Language Summary, select the Objects topic.

The index that appears displays an alphabetical list of Objects that are available in Microsoft Project.

REFERENCES

For more information about object reference (definition), choose the Search button in the Visual Basic Reference and type:

   object reference


Additional query words: 4.00
Keywords : kbcode kbole kbprg
Version : 4.0 4.1 4.1a 98
Platform : MACINTOSH WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 24, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.