XL: Assign Macro Dialog Box Doesn't Default to Assigned Macro

ID: Q152406

The information in this article applies to:

SYMPTOMS

When you select a drawing object that has a macro assigned to it, and then you click Assign Macro on the Tools Menu, the resulting Assign Macro dialog box may not show the correct reference to the assigned macro.

CAUSE

This may occur if the sheet containing the drawing object has been copied to a new workbook, and the drawing object in question is on the copied sheet. The default Macro Name/Reference edit box will contain the name of the new workbook followed by an exclamation point and the name of the original macro. The default reference is pointing to the defined name registered in this workbook and not directly to the macro's source location. If you click the Edit button on the Assign Macro dialog box while the default name is referenced, the message "Only Macro Names are Valid" will appear.

WORKAROUND

To see the correct macro reference, follow these steps:

1. Select the sheet that contains the drawing object.

2. On the Insert menu, point to Name, and then click Define.

3. Click the macro name in the Define Name dialog box. The Refers to

   edit box will show the correct reference.

4. Click OK to close the Define Name dialog box.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

Microsoft Excel 7.0

For more information about assigning a macro to a control, click Answer Wizard on the Help menu and type:

   how do I assign a macro to a control

Microsoft Press, "Microsoft Excel/Visual Basic Programmer's Guide," version 7.0, Chapter 8, "Controls and Dialog Boxes"

Microsoft Excel 5.0

For more information about assigning a macro to a control in Microsoft Excel version 5.0, click the Search button in Help and type:

   Buttons, Creating

"Visual Basic User's Guide," version 5.0, Chapter 11, "Controls and Dialog Boxes"

Additional query words: 5.00 5.00a 5.00c 7.00

Keywords          : kbprg xlmac xlnt xlwin 
Version           : WINDOWS: 5.0,5.0c,7.0,7.0a; MACINTOSH: 5.0
Platform          : MACINTOSH WINDOWS
Issue type        : kbbug

Last Reviewed: February 5, 1998