Microsoft KB Archive/67481

{| = Excel: Determining an Object's ID Number in a Macro =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q67481

SUMMARY
When a Microsoft Excel macro creates an object with the function CREATE.OBJECT, the function will return a text string containing the object's ID (for example, &quot;Oval 3&quot;). This ID can be used to select the object in later macro commands or can be used with functions such as GET.OBJECT.

If the object was created by copying and pasting an existing object, no value is returned to the macro. To determine the new object's ID, place a SELECTION statement directly after the PASTE function.

MORE INFORMATION
The following macro determines the value of an object that was copied and pasted from an existing object:

=SELECT(&quot;Oval 3&quot;) =COPY =PASTE =SELECTION =RETURN The macro selects the existing object (Oval 3), copies it, and pastes it, and the SELECTION statement obtains the ID of the object currently selected (after an object is pasted, it is automatically selected). For more information on the SELECTION statement, see page 214 of the &quot;Microsoft Excel Function Reference&quot; version 3.0 manual.
 * }