Thingol
Technical User
- Jan 2, 2002
- 169
Hi, I'm trying to make a custom toolbar with a button on it. The button should have a bitmap on it. Everything goes well, until I have to actually apply the bitmap to the button. I've tried this:
'The bitmap is in the same directory as the workbook, so in order
'to find the directory of the bitmap:
dim Bitmap
Bitmap = CStr(ThisWorkbook.Path)
'Then to set the properties of the button:
With ctlNewButton
.Width = 130
.Height = 52
.Picture = LoadPicture(Bitmap & "\Bitmap.bmp"
End With
Now an error message pops up, when I run this:
(this is a translation from Dutch):
Error 438
This property or method is not supported by this object.
The error message refers to the line:
.Picture = LoadPicture(Bitmap & "\Bitmap.bmp"
I think the .picture property isn't valid for ctlNewButton, except I don't know if there is any other way to assign a bitmap to a controlbarbutton.
Help, anybody?
'The bitmap is in the same directory as the workbook, so in order
'to find the directory of the bitmap:
dim Bitmap
Bitmap = CStr(ThisWorkbook.Path)
'Then to set the properties of the button:
With ctlNewButton
.Width = 130
.Height = 52
.Picture = LoadPicture(Bitmap & "\Bitmap.bmp"
End With
Now an error message pops up, when I run this:
(this is a translation from Dutch):
Error 438
This property or method is not supported by this object.
The error message refers to the line:
.Picture = LoadPicture(Bitmap & "\Bitmap.bmp"
I think the .picture property isn't valid for ctlNewButton, except I don't know if there is any other way to assign a bitmap to a controlbarbutton.
Help, anybody?