Restrict Command Button
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? |
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? |
Restrict Command Button
How would this affect the date and time stamp that the macro is used for? I
finally have a time and date stamp that works and does not reset itself every time the work book opens.I have tried deleting the command buttom from the other workbooks but then it deletes the command button on the orginal work book as well.Is there another way to do this? "Tom Ogilvy" wrote: 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? |
Restrict Command Button
You said commandbutton and then said it is on a toolbar.
Buttons on a toolbar are application level changes. I assume you have attached a commandbar to the workbook. by deleting it from other workbooks, I assume you have detached a copy of the commandbar from the otherworkbooks. If this is not the case, then you will need to explain exactly what you have done. If it is the case, then I have told you what you need to do. -- Regards, Tom Ogilvy "jk" wrote in message ... How would this affect the date and time stamp that the macro is used for? I finally have a time and date stamp that works and does not reset itself every time the work book opens.I have tried deleting the command buttom from the other workbooks but then it deletes the command button on the orginal work book as well.Is there another way to do this? "Tom Ogilvy" wrote: 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? |
Restrict Command Button
Thank you for telling me about the command button being an application level
change if placed on the toolbar. Since i am new to this, I was not aware of the impact so i moved it onto the sheet and it has resolved the problems.Thanks for the support. "Tom Ogilvy" wrote: You said commandbutton and then said it is on a toolbar. Buttons on a toolbar are application level changes. I assume you have attached a commandbar to the workbook. by deleting it from other workbooks, I assume you have detached a copy of the commandbar from the otherworkbooks. If this is not the case, then you will need to explain exactly what you have done. If it is the case, then I have told you what you need to do. -- Regards, Tom Ogilvy "jk" wrote in message ... How would this affect the date and time stamp that the macro is used for? I finally have a time and date stamp that works and does not reset itself every time the work book opens.I have tried deleting the command buttom from the other workbooks but then it deletes the command button on the orginal work book as well.Is there another way to do this? "Tom Ogilvy" wrote: 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? |
All times are GMT +1. The time now is 03:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com