M
mansoorm
Hi,
I've written some macros in excel 2002 to create a commandbar and some
command buttons.
Everything was OK while I was using excel 2002.
Excel 2003, displays errors that indicate some object libraries are
missing.(Microsoft office 10 object library)
How can I change the macros to run both in excel 2002 & 2003 ?
Here is one of my macros::
Sub SetButtonImage(myBtn As CommandBarButton, imfile As String,
Optional immask As String)
On Error GoTo HANDLE_ERROR
Dim picPicture As IPictureDisp
Dim picMask As IPictureDisp
Set picPicture = stdole.StdFunctions.LoadPicture(imfile)
myBtn.Picture = picPicture
If immask <> "" Then
Set picMask = stdole.StdFunctions.LoadPicture(immask)
myBtn.Mask = picMask
End If
NO_ERROR:
Exit Sub
HANDLE_ERROR:
MsgBox Err.Description
Resume NO_ERROR
End Sub
Any comment is appreciated
I've written some macros in excel 2002 to create a commandbar and some
command buttons.
Everything was OK while I was using excel 2002.
Excel 2003, displays errors that indicate some object libraries are
missing.(Microsoft office 10 object library)
How can I change the macros to run both in excel 2002 & 2003 ?
Here is one of my macros::
Sub SetButtonImage(myBtn As CommandBarButton, imfile As String,
Optional immask As String)
On Error GoTo HANDLE_ERROR
Dim picPicture As IPictureDisp
Dim picMask As IPictureDisp
Set picPicture = stdole.StdFunctions.LoadPicture(imfile)
myBtn.Picture = picPicture
If immask <> "" Then
Set picMask = stdole.StdFunctions.LoadPicture(immask)
myBtn.Mask = picMask
End If
NO_ERROR:
Exit Sub
HANDLE_ERROR:
MsgBox Err.Description
Resume NO_ERROR
End Sub
Any comment is appreciated