Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Can't Change Commandbars("Worksheet Menu Bar")

Hi NG;

Recently, my XL2000 installation stopped allowing programmatic changes to
the Worksheet Menu Bar. Code like this causes a
"Run-time error '-2147467259 (80004005)':
Method 'Add' of object 'CommandbarControls' failed"

Sub AddMenuItem()
Dim cb as CommandBar, cbp as CommandBarPopup
Set cb = Application.Commandbars("Worksheet Menu Bar")
Set cbp = cb.Controls.Add(Type:=msoControlPopup, Befo=8,
Temporary:=True) 'this is the line that causes the failure
'...
Set cb = Nothing: Set cbp = Nothing
End Sub

Can anyone tell me how to fix my installation? I have already completely
removed my Office installation, reinstalled and obtained and installed all
SPs. The problem is limited to Excel, Word and the other apps all allow
this modification. Also, I cannot manually add a new menu item with
[right-click] Customize...

TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Can't Change Commandbars("Worksheet Menu Bar")

Hi Tim

Try this

Often this is a corrupt or bloated toolbar file
*normal* size is < 30 kb.
The .xlb file has all Toolbar customization in it.

Close Excel
Do a search for .xlb in windows
Rename the file you find (my file is named Excel10.xlb in 2002)
Start Excel

Deleting the file or renaming will do no harm on your system
Excel will create a new one for you.
(You lost your customization remember that)

If you make your own toolbars or add buttons to the others
This file is important (backup it so you can restore it)


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tim" wrote in message ...
Hi NG;

Recently, my XL2000 installation stopped allowing programmatic changes to
the Worksheet Menu Bar. Code like this causes a
"Run-time error '-2147467259 (80004005)':
Method 'Add' of object 'CommandbarControls' failed"

Sub AddMenuItem()
Dim cb as CommandBar, cbp as CommandBarPopup
Set cb = Application.Commandbars("Worksheet Menu Bar")
Set cbp = cb.Controls.Add(Type:=msoControlPopup, Befo=8,
Temporary:=True) 'this is the line that causes the failure
'...
Set cb = Nothing: Set cbp = Nothing
End Sub

Can anyone tell me how to fix my installation? I have already completely
removed my Office installation, reinstalled and obtained and installed all
SPs. The problem is limited to Excel, Word and the other apps all allow
this modification. Also, I cannot manually add a new menu item with
[right-click] Customize...

TIA




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Can't Change Commandbars("Worksheet Menu Bar")

Thanks, Ron. This did the trick!

"Ron de Bruin" wrote in message
...
Hi Tim

Try this

Often this is a corrupt or bloated toolbar file
*normal* size is < 30 kb.
The .xlb file has all Toolbar customization in it.

Close Excel
Do a search for .xlb in windows
Rename the file you find (my file is named Excel10.xlb in 2002)
Start Excel

Deleting the file or renaming will do no harm on your system
Excel will create a new one for you.
(You lost your customization remember that)

If you make your own toolbars or add buttons to the others
This file is important (backup it so you can restore it)


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tim" wrote in message

...
Hi NG;

Recently, my XL2000 installation stopped allowing programmatic changes

to
the Worksheet Menu Bar. Code like this causes a
"Run-time error '-2147467259 (80004005)':
Method 'Add' of object 'CommandbarControls' failed"

Sub AddMenuItem()
Dim cb as CommandBar, cbp as CommandBarPopup
Set cb = Application.Commandbars("Worksheet Menu Bar")
Set cbp = cb.Controls.Add(Type:=msoControlPopup, Befo=8,
Temporary:=True) 'this is the line that causes the failure
'...
Set cb = Nothing: Set cbp = Nothing
End Sub

Can anyone tell me how to fix my installation? I have already

completely
removed my Office installation, reinstalled and obtained and installed

all
SPs. The problem is limited to Excel, Word and the other apps all allow
this modification. Also, I cannot manually add a new menu item with
[right-click] Customize...

TIA






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
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
Excel should have a "Change Case..." menu Item like Word!! Octapusgardenintheshade Excel Discussion (Misc queries) 1 November 22nd 05 06:32 PM
CommandBars("Insert").Enabled question Dusan[_2_] Excel Programming 1 November 28th 03 01:18 PM
Make "Worksheet Menu Bar" invisible or Delete/hide it's buttons Bob Phillips[_5_] Excel Programming 0 August 11th 03 01:05 PM


All times are GMT +1. The time now is 02:25 PM.

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"