LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Commandbutton picture problem

Hi,

I'm trying to set the picture of a commandbutton with VBA code in Excel and
I get an automation error:

-2147467259 (80004005)

Here's the code I'm using:

Dim cbDA As CommandBar
Dim cbtDA As CommandBarButton
Dim picPicture As IPictureDisp
Dim picMask As IPictureDisp

Set cbDA = Application.CommandBars("Data Analysis")

Set cbtDA = cbDA.Controls.Add(msoControlButton)
Set picPicture = stdole.StdFunctions.LoadPicture( _
"c:\corp_dev\Icon_Lib\eWorld 2000 Win\globe.ico")
With cbtDA
.Style = msoButtonIconAndCaption
.TooltipText = "Listing of available reports."
.Caption = "Reports"
.Visible = True
.Picture = picPicture
End With

I made sure the globe.ico file was correctly referenced and that stdole was
available. I even tried testing it with a common bmp file used by office
and it still failed.

What am I doing wrong?

Thanks,

--
Jim Bourque
 
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
Picture problem dwake Excel Discussion (Misc queries) 1 May 12th 10 07:40 PM
size FaceID picture on commandbutton RB Smissaert Excel Programming 2 January 7th 06 11:20 AM
Change CommandButton Picture TheVisionThing Excel Programming 0 December 14th 05 05:24 PM
Displaying a picture by pushing CommandButton Jean[_4_] Excel Programming 4 February 14th 05 11:39 AM
Enabled problem on commandbutton Swordster Excel Programming 1 May 18th 04 10:21 AM


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