View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Restrict Command Button

You would have to use the workbook_Open event to create it, and the
workbook_BeforeClose event to delete it. You would need the Activate and
deactivate events at the workbook level to unhide and hide it.

Also, you would add code to check if that particular workbook is the
activeworkbook when the code fires to insure no mistakes.

http://www.cpearson.com/excel/events.htm

for a discussion of events (Chip Pearson's site)

http://support.microsoft.com/default...b;en-us;830502
How to customize menus and menu bars in Excel

http://msdn.microsoft.com/library/en...ce04042002.asp

--
Regards,
Tom Ogilvy


"jk" wrote in message
...
I created a customized command buttom on the toolbar and assigned a macro
to
reset date and time on one work book under personal XLS. The problem is
now
every new workbook has this command button,,,,,,,how do i restrict or save
it
so it remains only in this one work book?