XL5: GP Fault Using INSERT.OBJECT Without All Arguments

ID: Q124311

5.00 WINDOWS kbprg kbole xlwin

The information in this article applies to:

SYMPTOMS

In Microsoft Excel, when you use the INSERT.OBJECT() function to insert an object, and you use the display_icon_logical argument set to the value TRUE, you may receive a general protection (GP) fault when you run the macro that contains this function.

CAUSE

This behavior occurs when you use the INSERT.OBJECT function with a display_icon_logical argument value of TRUE, and you omit either the icon_file or the icon_label argument. You do not receive a GP fault if you omit only the icon_number argument. You also do not receive a GP fault if you use the Null value, or "" for the value of the icon_file or icon_label argument.

Note that if you omit the icon_number argument when you use the INSERT.OBJECT function, you do not receive a GP fault, but the object is not inserted.

The display_icon_logical value of TRUE indicates that you want to insert an object using the application icon to display the object, instead of the default display for the object. However, if you do not include the information about what icon file to use, or the title for the icon, at least as the Null value "", you receive a GP fault when you run the macro.

Note that if you use the OLEObject object in a Visual Basic procedure to insert an object, and you do not use the icon_file, or icon_label arguments, you do not receive a GP fault, however, the specified object is not inserted.

WORKAROUNDS

To avoid receiving a GP fault when you use the INSERT.OBJECT function to insert an object using an icon display, always use the icon_file and icon_label arguments, even if they are Null, as in the following examples:

Microsoft provides macro examples for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This macro is provided 'as is' and Microsoft does not guarantee that the following code can be used in all situations. Microsoft does not support modifications of the code to suit customer requirements for a particular purpose.

Note that the code following each equal sign should be entered as a single line.

   =INSERT.OBJECT("Equation.2",,FALSE,TRUE,
      "C:\WIN3\MSAPPS\EQUATION\EQNEDIT.EXE",0,"Microsoft Equation 2.0")

   =INSERT.OBJECT("Equation.2",,FALSE,TRUE,
      "C:\WIN3\MSAPPS\EQUATION\EQNEDIT.EXE",0,"")

   =INSERT.OBJECT("Equation.2",,FALSE,TRUE,"",0,"Microsoft Equation 2.0")

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 5.0c.

MORE INFORMATION

When you use the INSERT.OBJECT function in Microsoft Excel version 5.0c, or the OLEObject object in a Visual Basic procedure in Microsoft Excel version 5.0 or 5.0c, the icon_file, icon_number, and icon_label arguments are still required to insert an object. However, you do not receive a GP fault if any of these arguments are omitted.

REFERENCES

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

    INSERT.OBJECT function

KBCategory: kbprg kbole KBSubcategory: xlwin

Additional reference words: 5.00 5.00a

Keywords          : xlwin 
Version           : 5.00
Platform          : WINDOWS

Last Reviewed: November 18, 1998