Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Menu gone, what am I doing wrong?
Hi once again,
This code works good save for one problem. When I exit Excel, my menu's don't return. As you see I have tried both the "Deactivate" and the "Close" events but I'm missing something. (All of these are in the workbook part). Private Sub workbook_open() Sheets("Sign").Select End Sub Private Sub Workbook_Activate() Application.CommandBars("Worksheet Menu Bar").Enabled = False End Sub Private Sub Workbook_Deactivate() Application.CommandBars("Worksheet Menu Bar").Enabled = True End Sub Private Sub Workbook_Close() Application.CommandBars("Worksheet Menu Bar").Enabled = True End Sub -- Thanks ....Kev... ....kev... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Menu gone, what am I doing wrong?
Kev,
As you are showing them, these are not the actual Workbook events. In the VBE ThisWorkbook module click on the dropdown menu at the top left and choose Workbook. In the dropdown menu at the top right, choose Workbook_BeforeClose, WorkBook_Deactivate, etc. Then put your code into those modules. Be aware that after the WorkBook_BeforeClose event runs, if there were changes to the workbook, the user can cancel the close at the "Save Changes?" prompt, so you the Workbook_Deactivate event is probably preferable. hth, Doug "kev" wrote in message ... Hi once again, This code works good save for one problem. When I exit Excel, my menu's don't return. As you see I have tried both the "Deactivate" and the "Close" events but I'm missing something. (All of these are in the workbook part). Private Sub workbook_open() Sheets("Sign").Select End Sub Private Sub Workbook_Activate() Application.CommandBars("Worksheet Menu Bar").Enabled = False End Sub Private Sub Workbook_Deactivate() Application.CommandBars("Worksheet Menu Bar").Enabled = True End Sub Private Sub Workbook_Close() Application.CommandBars("Worksheet Menu Bar").Enabled = True End Sub -- Thanks ...Kev... ...kev... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Menu gone, what am I doing wrong?
Kev,
I should have said that Workbook_Close is not a workbook event. The others are correctly named, but I would still try creating them as described in my previous post hth, Doug "Doug Glancy" wrote in message ... Kev, As you are showing them, these are not the actual Workbook events. In the VBE ThisWorkbook module click on the dropdown menu at the top left and choose Workbook. In the dropdown menu at the top right, choose Workbook_BeforeClose, WorkBook_Deactivate, etc. Then put your code into those modules. Be aware that after the WorkBook_BeforeClose event runs, if there were changes to the workbook, the user can cancel the close at the "Save Changes?" prompt, so you the Workbook_Deactivate event is probably preferable. hth, Doug "kev" wrote in message ... Hi once again, This code works good save for one problem. When I exit Excel, my menu's don't return. As you see I have tried both the "Deactivate" and the "Close" events but I'm missing something. (All of these are in the workbook part). Private Sub workbook_open() Sheets("Sign").Select End Sub Private Sub Workbook_Activate() Application.CommandBars("Worksheet Menu Bar").Enabled = False End Sub Private Sub Workbook_Deactivate() Application.CommandBars("Worksheet Menu Bar").Enabled = True End Sub Private Sub Workbook_Close() Application.CommandBars("Worksheet Menu Bar").Enabled = True End Sub -- Thanks ...Kev... ...kev... |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Menu gone, what am I doing wrong?
Works Great!
Thanks, This is why I come to all you Pro's. -- ....kev... "Doug Glancy" wrote: Kev, I should have said that Workbook_Close is not a workbook event. The others are correctly named, but I would still try creating them as described in my previous post hth, Doug "Doug Glancy" wrote in message ... Kev, As you are showing them, these are not the actual Workbook events. In the VBE ThisWorkbook module click on the dropdown menu at the top left and choose Workbook. In the dropdown menu at the top right, choose Workbook_BeforeClose, WorkBook_Deactivate, etc. Then put your code into those modules. Be aware that after the WorkBook_BeforeClose event runs, if there were changes to the workbook, the user can cancel the close at the "Save Changes?" prompt, so you the Workbook_Deactivate event is probably preferable. hth, Doug "kev" wrote in message ... Hi once again, This code works good save for one problem. When I exit Excel, my menu's don't return. As you see I have tried both the "Deactivate" and the "Close" events but I'm missing something. (All of these are in the workbook part). Private Sub workbook_open() Sheets("Sign").Select End Sub Private Sub Workbook_Activate() Application.CommandBars("Worksheet Menu Bar").Enabled = False End Sub Private Sub Workbook_Deactivate() Application.CommandBars("Worksheet Menu Bar").Enabled = True End Sub Private Sub Workbook_Close() Application.CommandBars("Worksheet Menu Bar").Enabled = True End Sub -- Thanks ...Kev... ...kev... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Drop dwn menu. Formula to count selection frm menu in anoth cell? | Excel Worksheet Functions | |||
Insert Calculated Field (wrong Qty*Price = wrong Amount) | Excel Discussion (Misc queries) | |||
filter dropdown menu so 2nd drop menu is customized | Excel Worksheet Functions | |||
Menu items added with menu item editor in older versions | Excel Discussion (Misc queries) | |||
Adding a menu item right click menu when clicking on a single. | Excel Programming |