Microsoft Knowledge Base

MXL5: Optional INSERT.OBJECT and OLEObject Arguments Recorded

Last reviewed: June 5, 1997
Article ID: Q124337
5.00 MACINTOSH kbprg kbole xlmac

The information in this article applies to:

  • Microsoft Excel for the Macintosh, version 5.0

SUMMARY

In Microsoft Excel, when you turn on the macro recorder, and you insert an object using the Display As Icon option, the arguments IconFileName, IconIndex, IconLabel (icon_file, icon_number, and icon_label for version 4.0 macro) are recorded. These arguments are optional on the Macintosh; they are not needed to insert an object using an icon display instead of the default display for the object.

MORE INFORMATION

This behavior occurs whether you record the macro using the Microsoft Excel version 4.0 macro language or the Visual Basic macro language. If you use the Microsoft Excel version 4.0 macro language, the recorded macro contains the INSERT.OBJECT function. If you use the Visual Basic language, the recorded macro contains the OLEObject object.

This behavior occurs because the IconFileName, IconIndex, and IconLabel arguments are required in Microsoft Excel for Windows when you use the OLEObject object to insert an object using an icon display. Similarly, the icon_file, icon_number, and icon_label icons are required when you use the INSERT.OBJECT function. These arguments provide information about the icon file to use, the number of the icon in the icon file to use, and the title to use for the icon if you choose to display the object as an icon. However, this information is not required in Microsoft Excel for the Macintosh.

For example, if you turn on the macro recorder, and insert a Microsoft Word 6.0 Document object on your worksheet, using the Display As Icon check box, one of the following commands is recorded:

Visual Basic

ActiveSheet.OLEObjects.Add(ClassType:="Word.Document.6", Link:=False, _

   DisplayAsIcon:=True, IconFileName:="Word.Document.6", IconIndex:=0, _
   IconLabel:="MS Word 6.0 Document").Activate

Version 4.0 Macro

=INSERT.OBJECT("Word.Document.6",,FALSE,TRUE,"Word.Document.6",0,"MS Word

   6.0 Document")

In each of these examples, the last three arguments may be omitted, and the code will still insert the object, using a blank icon with no title. Note, however, that these arguments are required in Microsoft Excel for Windows.

For additional information, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q124311
   TITLE     : XL5: GP Fault Using INSERT.OBJECT Without All Arguments

REFERENCES

For more information about INSERT.OBJECT, choose the Search button in the MS Excel Macro Function Help and type:

   INSERT.OBJECT Function


KBCategory: kbprg kbole
KBSubcategory: xlmac

Additional reference words: 5.00

Keywords : xlmac kbole kbprg
Version : 5.00
Platform : MACINTOSH


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: June 5, 1997
©1997 Microsoft Corporation. All rights reserved. Legal Notices.