![]() |
Menu customizations affect all workbooks?
Hi,
I am trying to customize a workbook, and will be adding several menu options that are specific to my user community. The menu additions are intended to be temporary, and should not affect the behavior of ANY other xls workbook. How do I ensure this happens? The menu options are added using VBA code during the workbook open sequence "auto_open()", and are removed during the "auto_close()" sequence. However, if someone is so foolish as to double click on an xls file while this special workbook is open they will have the added options available and I don't want them to even see the options, let alone click on them. In addition, I am disabling a few of the standard menu options ("Open...", and "New...") because they are meaningless in the context of my application. Am I looking for trouble by doing this? I don't think this will cause a problem, but who knows what MS has dreamed up for the unwary :) I would prefer that the double click action either does nothing, or launches a completely new instance of Excel with none of the menu modifications applied. Is this possible? If it is possible, how do I do this? I am not a VBA expert so a little patience is appreciated. Regards, Brad |
Menu customizations affect all workbooks?
Check out the Activate and Deactivate options. I have found this useful for
just this purpose. Private Sub Workbook_Activate() [ build macro] End Sub Private Sub Workbook_Deactivate() [delete macro] End Sub -- steveB Remove "AYN" from email to respond wrote in message oups.com... Hi, I am trying to customize a workbook, and will be adding several menu options that are specific to my user community. The menu additions are intended to be temporary, and should not affect the behavior of ANY other xls workbook. How do I ensure this happens? The menu options are added using VBA code during the workbook open sequence "auto_open()", and are removed during the "auto_close()" sequence. However, if someone is so foolish as to double click on an xls file while this special workbook is open they will have the added options available and I don't want them to even see the options, let alone click on them. In addition, I am disabling a few of the standard menu options ("Open...", and "New...") because they are meaningless in the context of my application. Am I looking for trouble by doing this? I don't think this will cause a problem, but who knows what MS has dreamed up for the unwary :) I would prefer that the double click action either does nothing, or launches a completely new instance of Excel with none of the menu modifications applied. Is this possible? If it is possible, how do I do this? I am not a VBA expert so a little patience is appreciated. Regards, Brad |
Menu customizations affect all workbooks?
This might be a help:
http://www.bygsoftware.com/Excel/VBA...tiveWbDemo.htm Or from the "Menu Routines" section on page: http://www.bygsoftware.com/examples/examples.htm It contains VBA code that will activate a menu only when the workbook it is in is active. The code is open and commented. -- Andy Wiggins FCCA www.BygSoftware.com Excel, Access and VBA Consultancy - wrote in message oups.com... Hi, I am trying to customize a workbook, and will be adding several menu options that are specific to my user community. The menu additions are intended to be temporary, and should not affect the behavior of ANY other xls workbook. How do I ensure this happens? The menu options are added using VBA code during the workbook open sequence "auto_open()", and are removed during the "auto_close()" sequence. However, if someone is so foolish as to double click on an xls file while this special workbook is open they will have the added options available and I don't want them to even see the options, let alone click on them. In addition, I am disabling a few of the standard menu options ("Open...", and "New...") because they are meaningless in the context of my application. Am I looking for trouble by doing this? I don't think this will cause a problem, but who knows what MS has dreamed up for the unwary :) I would prefer that the double click action either does nothing, or launches a completely new instance of Excel with none of the menu modifications applied. Is this possible? If it is possible, how do I do this? I am not a VBA expert so a little patience is appreciated. Regards, Brad |
Menu customizations affect all workbooks?
Thank you gentlemen, I appreciate the help!
Brad Andy Wiggins wrote: This might be a help: http://www.bygsoftware.com/Excel/VBA...tiveWbDemo.htm Or from the "Menu Routines" section on page: http://www.bygsoftware.com/examples/examples.htm It contains VBA code that will activate a menu only when the workbook it is in is active. The code is open and commented. -- Andy Wiggins FCCA www.BygSoftware.com Excel, Access and VBA Consultancy - wrote in message oups.com... Hi, I am trying to customize a workbook, and will be adding several menu options that are specific to my user community. The menu additions are intended to be temporary, and should not affect the behavior of ANY other xls workbook. How do I ensure this happens? The menu options are added using VBA code during the workbook open sequence "auto_open()", and are removed during the "auto_close()" sequence. However, if someone is so foolish as to double click on an xls file while this special workbook is open they will have the added options available and I don't want them to even see the options, let alone click on them. In addition, I am disabling a few of the standard menu options ("Open...", and "New...") because they are meaningless in the context of my application. Am I looking for trouble by doing this? I don't think this will cause a problem, but who knows what MS has dreamed up for the unwary :) I would prefer that the double click action either does nothing, or launches a completely new instance of Excel with none of the menu modifications applied. Is this possible? If it is possible, how do I do this? I am not a VBA expert so a little patience is appreciated. Regards, Brad |
All times are GMT +1. The time now is 03:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com