Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Below code gives error as cb.Picture = picPicture does not exists. Kindly
help me. I am using it for Excel 2000 VBA. Private Sub Workbook_Activate() 'sImageFile = ThisWorkbook.Path & "\ABC.jpg" Dim c As CommandBar Dim cb As CommandBarButton Dim picPicture As IPictureDisp Dim picMask As IPictureDisp 'you can also change the mask Set picPicture = stdole.StdFunctions.LoadPicture(ThisWorkbook.Path & "\ABC.jpg") 'optional - only of you have a mask file 'Set picMask = stdole.StdFunctions.LoadPicture("c:\...(your path)...\maskName.bmp") On Error Resume Next Application.CommandBars("BarName").Delete Set c = Application.CommandBars.Add("BarName", msoBarFloating, False, True) c.Enabled = True c.Visible = True Set cb = c.Controls.Add(msoControlButton) cb.Style = msoButtonIcon cb.Tag = "ButtonTest" 'Set the picture cb.Picture = picPicture 'Set the mask 'cb.Mask = picMask cb.OnAction = "ThisWorkbook.Test" Set cb = Nothing Set c = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
problem with opening hyperlink in excel 2000 | Links and Linking in Excel | |||
how do I run excel 4.0 macros on excel 2000 | Excel Discussion (Misc queries) | |||
Excel 2003 crashes loading excel files created Excel 2000 | Excel Discussion (Misc queries) | |||
other systems detecting excel 4.0 if excel 2000 is installed | Setting up and Configuration of Excel | |||
pivotcell object to excel 2000 | Excel Discussion (Misc queries) |