Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Run time error '-2147467259 (80004005) adding icon

Hi

I get the error

Run time error '-2147467259 (80004005)

Method 'Add' of object 'commandBarControls' failed.

why does this happen? basically i am trying to use that button image for a
to run a macro.

D

With .Add(msoControlButton, 749) <---- this line causes the
error.
.Style = msoButtonIconAndCaption
.Caption = "Create Individual Trainer Feedback Workbooks"
.OnAction = "CreateCourseFeedbackDocuments"
End With
With .Add(msoControlButton, 463)
.Style = msoButtonIconAndCaption
.Caption = "About"
.OnAction = "About"
End With
End With


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run time error '-2147467259 (80004005) adding icon

Sub EFG()
With Application.CommandBars( _
"Menu1")
With .Controls.Add(msoControlButton)
.Style = msoButtonIconAndCaption
.FaceId = 749
.Caption = "Create Individual Trainer Feedback Workbooks"
.OnAction = "CreateCourseFeedbackDocuments"
End With
With .Controls.Add(msoControlButton)
.Style = msoButtonIconAndCaption
.FaceId = 463
.Caption = "About"
.OnAction = "About"
End With
End With
End Sub

Sub CreateCourseFeedbackDocuments()
MsgBox "In CreateCourseFeedbackDocuments"
End Sub
Sub About()
MsgBox "In About"
End Sub

Change Menu1 to your commandbar. If you want it on the main menu, use
"Worksheet Menu Bar"

--
Regards,
Tom Ogilvy


"DMc2005" wrote in message
...
Hi

I get the error

Run time error '-2147467259 (80004005)

Method 'Add' of object 'commandBarControls' failed.

why does this happen? basically i am trying to use that button image for a
to run a macro.

D

With .Add(msoControlButton, 749) <---- this line causes the
error.
.Style = msoButtonIconAndCaption
.Caption = "Create Individual Trainer Feedback Workbooks"
.OnAction = "CreateCourseFeedbackDocuments"
End With
With .Add(msoControlButton, 463)
.Style = msoButtonIconAndCaption
.Caption = "About"
.OnAction = "About"
End With
End With




  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Run time error '-2147467259 (80004005) adding icon

thanks. why did it generate an error when it was on the same line?

D
"Tom Ogilvy" wrote in message
...
Sub EFG()
With Application.CommandBars( _
"Menu1")
With .Controls.Add(msoControlButton)
.Style = msoButtonIconAndCaption
.FaceId = 749
.Caption = "Create Individual Trainer Feedback Workbooks"
.OnAction = "CreateCourseFeedbackDocuments"
End With
With .Controls.Add(msoControlButton)
.Style = msoButtonIconAndCaption
.FaceId = 463
.Caption = "About"
.OnAction = "About"
End With
End With
End Sub

Sub CreateCourseFeedbackDocuments()
MsgBox "In CreateCourseFeedbackDocuments"
End Sub
Sub About()
MsgBox "In About"
End Sub

Change Menu1 to your commandbar. If you want it on the main menu, use
"Worksheet Menu Bar"

--
Regards,
Tom Ogilvy


"DMc2005" wrote in message
...
Hi

I get the error

Run time error '-2147467259 (80004005)

Method 'Add' of object 'commandBarControls' failed.

why does this happen? basically i am trying to use that button image for
a
to run a macro.

D

With .Add(msoControlButton, 749) <---- this line causes the
error.
.Style = msoButtonIconAndCaption
.Caption = "Create Individual Trainer Feedback Workbooks"
.OnAction = "CreateCourseFeedbackDocuments"
End With
With .Add(msoControlButton, 463)
.Style = msoButtonIconAndCaption
.Caption = "About"
.OnAction = "About"
End With
End With






  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run time error '-2147467259 (80004005) adding icon

On the same line you are talking about a built in commandbar ID: (from help)

Id Optional Variant. An integer that specifies a built-in control. If the
value of this argument is 1, or if this argument is omitted, a blank custom
control of the specified type will be added to the command bar.

You just wanted to use the ICON which is the FaceID - two different things.

--
Regards,
Tom Ogilvy


"DMc2005" wrote in message
...
thanks. why did it generate an error when it was on the same line?

D
"Tom Ogilvy" wrote in message
...
Sub EFG()
With Application.CommandBars( _
"Menu1")
With .Controls.Add(msoControlButton)
.Style = msoButtonIconAndCaption
.FaceId = 749
.Caption = "Create Individual Trainer Feedback Workbooks"
.OnAction = "CreateCourseFeedbackDocuments"
End With
With .Controls.Add(msoControlButton)
.Style = msoButtonIconAndCaption
.FaceId = 463
.Caption = "About"
.OnAction = "About"
End With
End With
End Sub

Sub CreateCourseFeedbackDocuments()
MsgBox "In CreateCourseFeedbackDocuments"
End Sub
Sub About()
MsgBox "In About"
End Sub

Change Menu1 to your commandbar. If you want it on the main menu, use
"Worksheet Menu Bar"

--
Regards,
Tom Ogilvy


"DMc2005" wrote in message
...
Hi

I get the error

Run time error '-2147467259 (80004005)

Method 'Add' of object 'commandBarControls' failed.

why does this happen? basically i am trying to use that button image

for
a
to run a macro.

D

With .Add(msoControlButton, 749) <---- this line causes the
error.
.Style = msoButtonIconAndCaption
.Caption = "Create Individual Trainer Feedback

Workbooks"
.OnAction = "CreateCourseFeedbackDocuments"
End With
With .Add(msoControlButton, 463)
.Style = msoButtonIconAndCaption
.Caption = "About"
.OnAction = "About"
End With
End With








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
System Error &H80004005 (-2147467259) Itzik Excel Discussion (Misc queries) 7 March 31st 11 10:45 AM
system Error &H80004005(-2147467259) jks Excel Discussion (Misc queries) 4 December 17th 08 09:50 PM
Run time error '-2147467259 (80004005) adding icon DMc2005 Excel Discussion (Misc queries) 3 October 2nd 05 04:39 PM
Automation Error(-2147467259) in Properties Collection Bob Phillips[_6_] Excel Programming 0 April 14th 05 04:27 PM
automation error -2147467259 Tim Cadieux[_2_] Excel Programming 0 November 5th 03 05:01 PM


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