Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kev Kev is offline
external usenet poster
 
Posts: 46
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Kev Kev is offline
external usenet poster
 
Posts: 46
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop dwn menu. Formula to count selection frm menu in anoth cell? ggoldber Excel Worksheet Functions 1 June 4th 08 02:21 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
filter dropdown menu so 2nd drop menu is customized menugal Excel Worksheet Functions 1 September 4th 07 05:25 PM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM


All times are GMT +1. The time now is 05:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"