Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Picture problem | Excel Discussion (Misc queries) | |||
size FaceID picture on commandbutton | Excel Programming | |||
Change CommandButton Picture | Excel Programming | |||
Displaying a picture by pushing CommandButton | Excel Programming | |||
Enabled problem on commandbutton | Excel Programming |