xenou
MrExcel MVP
- Joined
- Mar 2, 2007
- Messages
- 16,836
- Office Version
- 2019
- Platform
- Windows
Hi:
I have a custom toolbar menu that I'd like to have available only on Sheet1 (to avoid users running macros on the wrong sheet). Everything works fine except when starting Excel as a new session - the workbook will not display the custom menu even when the correct sheet is active when the workbook opens.
I have the menu coded in a sheet_activate / sheet_deactivate event.
NOTE: Activating the sheet in a workbook_open event does not help!! It appears I only have this issue when I start the excel application by clicking on the file icon and Excel is NOT currently open.
1) Is there a way to trigger the sheet_activation event on opening the workbook in a new Excel session?
2) Is there a better design approach?
'-------
Apropros of #2 I imagine I can: validate all macros for the correct sheet before any of them run (so as to be able to display the menu at all times), have a workbook open to a "welcome" sheet, forcing the user to switch to the sheet and thereby activate it. Other ideas? But I hope there is a simpler answer a la question #1 above.
TIA.
I have a custom toolbar menu that I'd like to have available only on Sheet1 (to avoid users running macros on the wrong sheet). Everything works fine except when starting Excel as a new session - the workbook will not display the custom menu even when the correct sheet is active when the workbook opens.
I have the menu coded in a sheet_activate / sheet_deactivate event.
NOTE: Activating the sheet in a workbook_open event does not help!! It appears I only have this issue when I start the excel application by clicking on the file icon and Excel is NOT currently open.
1) Is there a way to trigger the sheet_activation event on opening the workbook in a new Excel session?
2) Is there a better design approach?
'-------
Apropros of #2 I imagine I can: validate all macros for the correct sheet before any of them run (so as to be able to display the menu at all times), have a workbook open to a "welcome" sheet, forcing the user to switch to the sheet and thereby activate it. Other ideas? But I hope there is a simpler answer a la question #1 above.
TIA.