Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

Hi

I found these codes from a book but it has a few problems.

Sub ListFirstLevelControls()

Dim cbctl As CommandBar
Dim cbBar As CommandBar
Dim i As Integer
On Error Resume Next

i = 2

-----If Not isemptyworksheet(ActiveSheet) Then Exit Sub
For Each cbBar In CommandBars
Application.StatusBar = "Processing Bar" & cbBar.Name
Cells(i, 1) = cbBar.Name
i = i + 1
For Each cbctl In cbBar.Controls
------Cells(i, 2) = cbctl.Caption
cb.ctl.CopyFace
If Err.Number = 0 Then
ActiveSheet.Paste Cells(i, 3)
------Cells(i, 3) = cbctl.FaceId
End If
Cells(i, 4) = cbctl.ID
Err.Clear
i = i + 1
Next cbctl
Next cbBar


End Sub

When I try to run these codes 'sub or function not defined' coming up. I
have shown the problem lines above by -------.

How to get around this?

Could someone help?

Thank You
M Varnendra



"Varne" wrote:

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

I'd try:

Tools|Customize|Toolbars tab
select the Worksheet Menu Bar
click reset

If you've customized this toolbar, you'll have to do it again.

Varne wrote:

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

Hi Dave

I tried but I am not able to bring back what I have deleted.

By the way;

I have been able to run the codes I put forward for error detection. ('But
If Not isemptyworksheet(ActiveSheet) Then Exit Sub is still wrong so I took
it out)

It produced some results but there is no 'Sheet'.

Instead it has 'Ply' underwhich I found items like Rename which belong to
sheet menu.

However I like to know the codes to insert '&Rename' into sheet menu.

Do you know?

Thanks

M Varnendra



"Dave Peterson" wrote:

I'd try:

Tools|Customize|Toolbars tab
select the Worksheet Menu Bar
click reset

If you've customized this toolbar, you'll have to do it again.

Varne wrote:

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

Got it.

Application.CommandBars("Sheet").Controls.Add Type:=msoControlButton, ID:= _
889, Befo=1
That is for 'Rename'

But I do not have the ID for 'Hide'

Can somebody give me the ID please?

Thanks.

M Varnendra


"Varne" wrote:

Hi Dave

I tried but I am not able to bring back what I have deleted.

By the way;

I have been able to run the codes I put forward for error detection. ('But
If Not isemptyworksheet(ActiveSheet) Then Exit Sub is still wrong so I took
it out)

It produced some results but there is no 'Sheet'.

Instead it has 'Ply' underwhich I found items like Rename which belong to
sheet menu.

However I like to know the codes to insert '&Rename' into sheet menu.

Do you know?

Thanks

M Varnendra



"Dave Peterson" wrote:

I'd try:

Tools|Customize|Toolbars tab
select the Worksheet Menu Bar
click reset

If you've customized this toolbar, you'll have to do it again.

Varne wrote:

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

Hide and unhide are 890 and 891 but they did not appear in the list - my
second query - created. Vould an expert answer?

Thank You.

M Varnendra

"Varne" wrote:

Got it.

Application.CommandBars("Sheet").Controls.Add Type:=msoControlButton, ID:= _
889, Befo=1
That is for 'Rename'

But I do not have the ID for 'Hide'

Can somebody give me the ID please?

Thanks.

M Varnendra


"Varne" wrote:

Hi Dave

I tried but I am not able to bring back what I have deleted.

By the way;

I have been able to run the codes I put forward for error detection. ('But
If Not isemptyworksheet(ActiveSheet) Then Exit Sub is still wrong so I took
it out)

It produced some results but there is no 'Sheet'.

Instead it has 'Ply' underwhich I found items like Rename which belong to
sheet menu.

However I like to know the codes to insert '&Rename' into sheet menu.

Do you know?

Thanks

M Varnendra



"Dave Peterson" wrote:

I'd try:

Tools|Customize|Toolbars tab
select the Worksheet Menu Bar
click reset

If you've customized this toolbar, you'll have to do it again.

Varne wrote:

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra

--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

I don't know what isemptyworksheet() does, so I don't have a guess for that.

The Ply commandbar is the dialog you see when you rightclick on a sheet tab.

This kind of line will reset the Format popup under the worksheet menu bar:
Application.CommandBars("worksheet menu bar").Controls("format").Reset

I used this to find the ids:

Option Explicit
Sub testme()

Dim ctrl As CommandBarControl
Dim cc As CommandBarControl
Set ctrl = Application.CommandBars("worksheet menu bar").Controls("format")

For Each cc In ctrl.Controls
Debug.Print cc.Caption & "--" & cc.ID
Next cc

End Sub

I use xl2003 and got these id's:

C&ells...--855
&Row--30024
&Column--30025
S&heet--30026
&AutoFormat...--786
Con&ditional Formatting...--3058
&Style...--254
Phone&tic Guide--30136



Varne wrote:

Hi Dave

I tried but I am not able to bring back what I have deleted.

By the way;

I have been able to run the codes I put forward for error detection. ('But
If Not isemptyworksheet(ActiveSheet) Then Exit Sub is still wrong so I took
it out)

It produced some results but there is no 'Sheet'.

Instead it has 'Ply' underwhich I found items like Rename which belong to
sheet menu.

However I like to know the codes to insert '&Rename' into sheet menu.

Do you know?

Thanks

M Varnendra

"Dave Peterson" wrote:

I'd try:

Tools|Customize|Toolbars tab
select the Worksheet Menu Bar
click reset

If you've customized this toolbar, you'll have to do it again.

Varne wrote:

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

I should have gone one level deeper:

Option Explicit
Sub testme()

Dim ctrl As CommandBarControl
Dim cc As CommandBarControl
Set ctrl = Application.CommandBars("worksheet menu bar") _
.Controls("format").Controls("sheet")

For Each cc In ctrl.Controls
Debug.Print cc.Caption & "--" & cc.ID
Next cc

End Sub


&Rename--889
&Hide--890
&Unhide...--891
&Background...--952
&Tab Color...--5747


Dave Peterson wrote:

I don't know what isemptyworksheet() does, so I don't have a guess for that.

The Ply commandbar is the dialog you see when you rightclick on a sheet tab.

This kind of line will reset the Format popup under the worksheet menu bar:
Application.CommandBars("worksheet menu bar").Controls("format").Reset

I used this to find the ids:

Option Explicit
Sub testme()

Dim ctrl As CommandBarControl
Dim cc As CommandBarControl
Set ctrl = Application.CommandBars("worksheet menu bar").Controls("format")

For Each cc In ctrl.Controls
Debug.Print cc.Caption & "--" & cc.ID
Next cc

End Sub

I use xl2003 and got these id's:

C&ells...--855
&Row--30024
&Column--30025
S&heet--30026
&AutoFormat...--786
Con&ditional Formatting...--3058
&Style...--254
Phone&tic Guide--30136

Varne wrote:

Hi Dave

I tried but I am not able to bring back what I have deleted.

By the way;

I have been able to run the codes I put forward for error detection. ('But
If Not isemptyworksheet(ActiveSheet) Then Exit Sub is still wrong so I took
it out)

It produced some results but there is no 'Sheet'.

Instead it has 'Ply' underwhich I found items like Rename which belong to
sheet menu.

However I like to know the codes to insert '&Rename' into sheet menu.

Do you know?

Thanks

M Varnendra

"Dave Peterson" wrote:

I'd try:

Tools|Customize|Toolbars tab
select the Worksheet Menu Bar
click reset

If you've customized this toolbar, you'll have to do it again.

Varne wrote:

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 126
Default Controls in Sheets (Hide etc.) in Format Menu Not appearing

Hi Dave

Let me reply on Monday.

Thank you for your response.

M Varnendra

"Dave Peterson" wrote:

I don't know what isemptyworksheet() does, so I don't have a guess for that.

The Ply commandbar is the dialog you see when you rightclick on a sheet tab.

This kind of line will reset the Format popup under the worksheet menu bar:
Application.CommandBars("worksheet menu bar").Controls("format").Reset

I used this to find the ids:

Option Explicit
Sub testme()

Dim ctrl As CommandBarControl
Dim cc As CommandBarControl
Set ctrl = Application.CommandBars("worksheet menu bar").Controls("format")

For Each cc In ctrl.Controls
Debug.Print cc.Caption & "--" & cc.ID
Next cc

End Sub

I use xl2003 and got these id's:

C&ells...--855
&Row--30024
&Column--30025
S&heet--30026
&AutoFormat...--786
Con&ditional Formatting...--3058
&Style...--254
Phone&tic Guide--30136



Varne wrote:

Hi Dave

I tried but I am not able to bring back what I have deleted.

By the way;

I have been able to run the codes I put forward for error detection. ('But
If Not isemptyworksheet(ActiveSheet) Then Exit Sub is still wrong so I took
it out)

It produced some results but there is no 'Sheet'.

Instead it has 'Ply' underwhich I found items like Rename which belong to
sheet menu.

However I like to know the codes to insert '&Rename' into sheet menu.

Do you know?

Thanks

M Varnendra

"Dave Peterson" wrote:

I'd try:

Tools|Customize|Toolbars tab
select the Worksheet Menu Bar
click reset

If you've customized this toolbar, you'll have to do it again.

Varne wrote:

Hi

Could someone help on this please.

I have accidently deleted Hide, Unhide, Rename and other controls in
FormatSheets menu. I like to reinstate them through VBA. I tried through
ToolsBuilt In Menus but it is still empty.

Thank You
M Varnendra

--

Dave Peterson


--

Dave Peterson

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
Macro's not appearing in new spread sheets Jimmy Jones Setting up and Configuration of Excel 0 October 30th 07 05:09 PM
read-only option not appearing on file menu marnie Excel Discussion (Misc queries) 1 October 16th 07 04:38 PM
read-only option not appearing on file menu marnie Excel Discussion (Misc queries) 2 October 16th 07 03:21 PM
Macros Menu Keeps Appearing Portocar Excel Discussion (Misc queries) 2 November 13th 06 11:35 PM
Format decimal controls do not work jimcrowl Excel Discussion (Misc queries) 2 January 7th 05 09:20 PM


All times are GMT +1. The time now is 10:06 PM.

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

About Us

"It's about Microsoft Excel"