I'd like to use a Home button image on a button in a spreadsheet (Office 2010).
I think I can do it using the FileName operand of the OLEObjects.Add method, but I'm struggling to find an example of how to do so.
I had originally mis-remembered that there was an image of a house in the imageres.dll file, so I was going to try to use that, assuming that I could use code like
Although this compiles, I'm not sure it would execute!
And in any case, there doesn't seem to be a "House" button in that dll (although there are others I could use).
Does anyone know where I can see some sample code which uses this method to create a button?
All help gratefully received....
I think I can do it using the FileName operand of the OLEObjects.Add method, but I'm struggling to find an example of how to do so.
I had originally mis-remembered that there was an image of a house in the imageres.dll file, so I was going to try to use that, assuming that I could use code like
Code:
Sub samplecode()
Dim objButton As OLEObject
Dim lngIdx, lngL, lngT, lngW, lngH
'
' Code to set relevant variables
' removed for brevity
'
With ActiveSheet.OLEObjects
Set objButton = .Add( _
DisplayAsIcon:=True, _
iconFilename:="%SystemRoot%\system32\SHELL32.dll", _
iconindex:=lngIdx, _
Link:=False, _
Left:=lngL, _
Top:=lngT, _
Width:=lngW, _
Height:=lngH)
End With
End Sub
And in any case, there doesn't seem to be a "House" button in that dll (although there are others I could use).
Does anyone know where I can see some sample code which uses this method to create a button?
All help gratefully received....