workbook specific macro code

Vicky9063

Board Regular
Joined
Oct 27, 2005
Messages
79
Hi,
I have created a workbook that i have tried to stop people deleting tabs from by disabling the tab toolbar. This has worked, but if i open up a spreadsheet that is not part of the workbook it also disables the tab toolbar in that spreadsheet.

Code:
'Disables the PLY Sheet function in the toolbar
Application.CommandBars("ply").Enabled = False

How do i make the code only specific to the workbook that i have the macro saved in??
Thanks
vicky
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

tmcfadden

Board Regular
Joined
Aug 17, 2005
Messages
151
To my knowledge, you can't make toolbars specific to the workbook ( hence the Application. prefix ).

Normally you'd use a 'Protection' scheme to stop people from deleting things. If you protect the workbook, users won't be able to delete worksheets.

-Tim
 

Watch MrExcel Video

Forum statistics

Threads
1,108,624
Messages
5,523,968
Members
409,547
Latest member
AW2020

This Week's Hot Topics

Top