XL98: How to Use a Toolbar Button to Open a File Indirectly
ID: Q193427
|
The information in this article applies to:
-
Microsoft Excel 98 Macintosh Edition
SUMMARY
In Microsoft Excel 98 Macintosh Edition, you can indirectly associate a
workbook with a custom button in another workbook by assigning a macro in
the associated workbook to the button.
For example, if you have a workbook named "My Workbook" that contains a
button, you can indirectly associate a second workbook called "Main
Workbook" with that button by assigning a Microsoft Visual Basic for
Applications module in "Main Workbook" to the button. When you click the
button in "My Workbook," the second workbook, "Main Workbook," is opened
automatically.
MORE INFORMATION
To associate a workbook with a custom button, do the following:
- In Microsoft Excel, create a new workbook.
- Press OPTION+F11 to activate the Visual Basic Editor. (Or, click the
Tools menu, point to Macro, and then click Visual Basic Editor.)
- Click Module on the Insert menu. In the Code window, type the
following code:
Sub Test()
End Sub
- Click Close and Return to Microsoft Excel on the File menu to return
to the workbook.
- On the View menu, point to Toolbars and click Customize.
- Click the Command tab in the Toolbars dialog box. Select Macros in
the Categories list box.
- Drag the Custom Button over a toolbar and release the mouse button.
- Click Modify Selection in the Customize dialog box, and then click
Assign Macro on the menu that appears. Click Test Macro name listbox,
and then click OK.
This will assign the macro Test to the custom button.
- In the Customize dialog box, click Close.
- On the File menu, click Save.
- On the File menu, Click Close.
When you click the custom button, your file is opened; because the sample
macro has no commands, it runs without performing any actions.
Additional query words:
XL98
Keywords : kbdta xlvbahowto xlvbainfo
Version : MACINTOSH:98
Platform : MACINTOSH
Issue type : kbhowto
|