View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default to remove a custom Toolbar Button & macro

But something was wrong when I've assigned macro

No, nothing is wrong, this is just how Excel works. Toolbars do not belong
to a workbook, even the workbook that the macros assigned to the toolbar are
in. Toolbars belong to Excel. Once you create one it will be there
regardless of which workbooks are present. To get rid of it you have to
delete it manually or through code. To control a toolbar the way you want
requires using VB code with the Commandbars object. This isn't brain
surgery but it is something that takes some time and study to get the hang
of. If you don't want to go down this road you might be better off just
putting a button on your worksheet(s) that runs your macro.

--
Jim
"luminore" wrote in message
...
| I've put macro in module, then make a custom button on the toolbar to
invoke
| a macro.(according to excel help):
|
| --------------------------------------
| Create a toolbar button that runs your macro
|
| 1. On the Tools menu, click Customize, and then click the
| Commands tab.
|
| 2. Under Categories, click Macros.
|
| 3. Drag the custom button to the toolbar where you want it.
|
| 4. On the Customize dialog box, click Modify Selection,
| and then click Assign Macro.
|
| 5. In the Assign Macro dialog box, click the name of your
| macro, and then click OK.
|
| 6. To change the appearance of the button, click Modify
| Selection again, point to Change Button Image, and click one of the
| available images; or click Edit Button Image and use the Button Editor to
| create your own image.
|
| 7. Click Close.
| -----------------------------------------------------
|
| But something was wrong when I've assigned macro, and I find that this
| custom Toolbar button appers in all my Excel documents.
|
| When I click on it, it show that workbook contains macros, though there
was
| no macro earlier. I find that this button attach "Module1" macro to Excel
| file when I click on it. So, all Excel document now have this nasty
button,
| that insert macro in workbook.
|
| How to remove this Toolbar Button from all Excel documents? How to remove
| this unwanted macro from workbooks where this module has been already
| inserted?
|
| Thanks
|
|