XL5 Err Msg: "OLE Automation Error" or "Out of Memory"

Last reviewed: September 2, 1997
Article ID: Q118379
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows NT, version 5.0
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

In Microsoft Excel, when you run a Visual Basic, Applications Edition, macro, you may receive one of the following error messages:

   OLE Automation Error

   -or-

   Out of Memory

CAUSE

These error messages typically occur when the macro is referring to a worksheet object.

MORE INFORMATION

Every call between a Visual Basic module and a Microsoft Excel worksheet is made through Object Linking and Embedding (OLE). When you run a macro, you usually receive descriptive error messages when OLE errors occur. However, if OLE encounters an unresolvable error, you may receive one of the error messages above.

For example, if you run the following Visual Basic macro code, you will receive an error:

   Msgbox Sheets("Sheet1").Parent

In this example, information is requested from an object instead of from a property of that object. Since the object doesn't give a property, Visual Basic tries to return the default property, ".Value." Because worksheets do not have a Value property, you receive an OLE Automation error.

The correct syntax for the statement above would be:

   Msgbox Sheets("Sheet1").Parent.Name

REFERENCES

"Visual Basic User's Guide," Microsoft Excel 5.0, page 189


Additional query words: 7.00 5.00 value
Keywords : IntpOthr kbinterop kbprg kbprg
Version : 5.00 5.00c 7.00
Platform : WINDOWS


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: September 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.