XL5: Error Choosing Button After Assigning MacroID: Q119437
|
In Microsoft Excel, if you use a Visual Basic procedure to assign a macro to a custom toolbar button, you receive the following error message when you choose the button
where <Assigned_Macro> is the name of the macro you assigned to the button, and <BOOK.XLS> is the name of an open workbook that contains a macro, but does not contain Assigned_Macro.Cannot find macro ''C:\EXCEL\<BOOK.XLS>'!<Assigned_Macro>'
This behavior occurs when you use a procedure contained in one workbook to
assign a macro contained in the active workbook to a toolbar button. In
this case, the name of the workbook from which you run the procedure to
assign the macro is incorrectly added to the macro name that is assigned to
the button.
For example, if you use a procedure in BOOK.XLS to assign the macro
Assigned_Macro contained in MACRO.XLS to a toolbar button, and MACRO.XLS is
the active workbook, the following macro name is assigned to the button:
BOOK.XLS!Assigned_Macro
Application.Dialogs(xlDialogAssignToTool).Show arg1:="Toolbar1", arg2:=1
Sub Assign_To_Button()
' The following line assigns the macro Assigned_Macro
' to the first button on the toolbar named Toolbar1
Toolbars("Toolbar1").ToolbarButtons(1).OnAction = "Assigned_Macro"
End Sub
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. This problem was corrected in a
later version of Microsoft Excel.
For more information about Assigning A Macro To A Custom Button On A
Toolbar, choose the Search button in Help and type:
assigning macros
Additional query words: 1.00 err msg
Keywords :
Version : 5.00
Platform : WINDOWS
Issue type :
Last Reviewed: July 14, 1999