Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 Command bars

I have an add-in that uses:

Set MenuObject = Application.CommandBars(1). _
Controls.Add(Type:=msoControlPopup, _
Befo=PositionOrMacro, _
Temporary:=True)
MenuObject.Caption = Caption

to create a new menu item. It works fine on 98% of our supposedly
identical machines but on the other 2% it will not run. I've seen
"Detect and Repair" occasionally fix the problem but not on all
machines. Anyone know what's going on and how to fix it?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Excel 2003 Command bars

What happens when it "will not run"? Error messages? Nothing happening?
Details count.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


wrote in message
oups.com...
I have an add-in that uses:

Set MenuObject = Application.CommandBars(1). _
Controls.Add(Type:=msoControlPopup, _
Befo=PositionOrMacro, _
Temporary:=True)
MenuObject.Caption = Caption

to create a new menu item. It works fine on 98% of our supposedly
identical machines but on the other 2% it will not run. I've seen
"Detect and Repair" occasionally fix the problem but not on all
machines. Anyone know what's going on and how to fix it?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 Command bars

The error message I get is:

Run-Time Error '-2147467259 (80004005)' Method 'Add' of object
'CommandBarControls' failed.

You can either End the macro or go to Debug mode.

Is there anything else I can provide to help in diagnosing the issue.
As a reminder, the exact same code is in production on roughly 100
machines with no issues.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel 2003 Command bars

If, for any reason, the worksheet menu bar is protected you will get this
error. You might add this code just before yours:

Application.CommandBars(1).Protection = msoBarNoProtection

Of course there may be some other reason for the problem.

--
Jim
wrote in message
oups.com...
| The error message I get is:
|
| Run-Time Error '-2147467259 (80004005)' Method 'Add' of object
| 'CommandBarControls' failed.
|
| You can either End the macro or go to Debug mode.
|
| Is there anything else I can provide to help in diagnosing the issue.
| As a reminder, the exact same code is in production on roughly 100
| machines with no issues.
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 Command bars

Problem solved. The user had a corrupted profile, i.e. the folder c:
\documents and settings\<user id\Application Data did not exist.
Logging on an as admin, renaming the user's old profile and having the
user log on (which causes a new profile to be created) solved the
problem.

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
URGENT HELP REQUIRED - EXCEL LOADS WITHOUT ANY COMMAND BARS AN francisA Excel Discussion (Misc queries) 1 May 8th 09 12:41 PM
VSTO 2003 Excel Command Bars BIZI Excel Programming 2 January 15th 06 07:14 AM
Disable Excel Command Bars and Remove Irritating Grey Bar Andy B via OfficeKB.com Excel Programming 0 December 8th 05 09:23 AM
Hide all Excel tool/command bars except mine and reload on close Matt Jensen Excel Programming 2 December 20th 04 05:44 PM
Minimize/Maximize excel restores command bars Rockee052[_53_] Excel Programming 3 March 3rd 04 12:27 AM


All times are GMT +1. The time now is 01:11 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"