Microsoft KB Archive/152406

= Assign Macro Dialog Box Doesn't Default to Assigned Macro =

Article ID: 152406

Article Last Modified on 8/15/2003

-

APPLIES TO


 * Microsoft Excel 95a
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Excel 5.0a for Macintosh

-



This article was previously published under Q152406



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.



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.00a 5.00c XL

Keywords: kbbug kbprogramming KB152406

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.