ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet tab popup menu not working (https://www.excelbanter.com/excel-programming/342260-worksheet-tab-popup-menu-not-working.html)

suzetter[_13_]

Worksheet tab popup menu not working
 

I have been experimenting with some code in Excel 2003 to hide
comandbars. Unfortunately somehow I accidentily disabled a few shortcut
menu bars, like the right-click menu bar for the cell, row, column and
worksheet tab
I have thus far been enable to re-enable the right-click shortcut menu
for the cell, row and column, but cannot restore the right-click
shortcut menu for the worksheet tab...the one where you get the options
to Rename, Hide, Unhide etc.
I have tried the following code and all the code works except the one
for the "Sheet"


Code:
--------------------

Sub EnableMenus()
Dim myexcel As Object

Set myexcel = GetObject(, "Excel.Application") 'Point to active excel application
myexcel.CommandBars("Cell").Enabled = True
myexcel.CommandBars("Row").Enabled = True
myexcel.CommandBars("Column").Enabled = True
myexcel.CommandBars("Sheet").Enabled = True

End Sub

--------------------


I even tried to reset all the menubars using the following code and it
still doesn't work


Code:
--------------------

Sub EnableMenus()
Dim myexcel As Object

myexcel.MenuBars("worksheet").Reset

End Sub

--------------------


Any assistance would be appreaciated on how to restore the right-click
shortcut menu bar for the worksheet tab or how to reset all the
shortcut menu bars


--
suzetter
------------------------------------------------------------------------
suzetter's Profile: http://www.excelforum.com/member.php...fo&userid=7078
View this thread: http://www.excelforum.com/showthread...hreadid=474414


suzetter[_14_]

Worksheet tab popup menu not working
 

Ok, it didn't take that long did it, but I figured it out


Code:
--------------------

Sub EnableMenus()
Dim myexcel As Object

Set myexcel = GetObject(, "Excel.Application") 'Point to active excel application
myexcel.CommandBars("Ply").Enabled = True

End Sub

--------------------


But, is there a command that will automatically restore all the short
cut menus, because I have no idea what other shortcut menus I may have
disabled


--
suzetter
------------------------------------------------------------------------
suzetter's Profile: http://www.excelforum.com/member.php...fo&userid=7078
View this thread: http://www.excelforum.com/showthread...hreadid=474414


Jim Cone

Worksheet tab popup menu not working
 
suzetter,
'------------------------------
Sub ShowThemCritters()
Dim cmdBar As CommandBar
For Each cmdBar In Application.CommandBars
If cmdBar.Type = msoBarTypePopup Then cmdBar.Enabled = True
Next 'cmdBar
Set cmdBar = Nothing
End Sub
'---------------------------
Jim Cone
San Francisco, USA


"suzetter" wrote in message

Ok, it didn't take that long did it, but I figured it out
Code:
--------------------
Sub EnableMenus()
Dim myexcel As Object
Set myexcel = GetObject(, "Excel.Application") 'Point to active excel application
myexcel.CommandBars("Ply").Enabled = True
End Sub
--------------------
But, is there a command that will automatically restore all the short
cut menus, because I have no idea what other shortcut menus I may have
disabled
suzetter


Dave Peterson

Worksheet tab popup menu not working
 
Just a suggestion while you're doing your experimenting...

Close excel
use windows start button|search
to look for the current *.xlb file (where excel stores customizations to your
toolbar)

Make a backup copy of that file.

When your experiments go awry (and they will!), you can just close excel and
copy the backup version of your *.xlb file into its rightful location and you'll
be back to what you had before.



suzetter wrote:

I have been experimenting with some code in Excel 2003 to hide
comandbars. Unfortunately somehow I accidentily disabled a few shortcut
menu bars, like the right-click menu bar for the cell, row, column and
worksheet tab
I have thus far been enable to re-enable the right-click shortcut menu
for the cell, row and column, but cannot restore the right-click
shortcut menu for the worksheet tab...the one where you get the options
to Rename, Hide, Unhide etc.
I have tried the following code and all the code works except the one
for the "Sheet"

Code:
--------------------

Sub EnableMenus()
Dim myexcel As Object

Set myexcel = GetObject(, "Excel.Application") 'Point to active excel application
myexcel.CommandBars("Cell").Enabled = True
myexcel.CommandBars("Row").Enabled = True
myexcel.CommandBars("Column").Enabled = True
myexcel.CommandBars("Sheet").Enabled = True

End Sub

--------------------

I even tried to reset all the menubars using the following code and it
still doesn't work

Code:
--------------------

Sub EnableMenus()
Dim myexcel As Object

myexcel.MenuBars("worksheet").Reset

End Sub

--------------------

Any assistance would be appreaciated on how to restore the right-click
shortcut menu bar for the worksheet tab or how to reset all the
shortcut menu bars

--
suzetter
------------------------------------------------------------------------
suzetter's Profile: http://www.excelforum.com/member.php...fo&userid=7078
View this thread: http://www.excelforum.com/showthread...hreadid=474414


--

Dave Peterson


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com