No, that doesn't work, or what library reference are you using?
> Hi Kevin,
>
[quoted text clipped - 31 lines]
> > TIA
> > KM
Norman Jones - 24 May 2006 17:51 GMT
Hi Kevin,
> No, that doesn't work, or what library reference are you using?
My test code was:
'=============>>
Public Sub Tester0012()
Dim ws As Worksheet
Dim myPic As Picture
Set ws = Sheets("Sheet1")
Set myPic = ws.Pictures("LOGO_1")
If Not myPic Is Nothing Then
'do something, e.g,:
MsgBox myPic.TopLeftCell.Address
End If
End Sub
'<<=============
---
Regards,
Norman
Norman Jones - 24 May 2006 17:56 GMT
Hi Kevin,
> Set myPic = ws.Pictures("LOGO_1")
should be:
On Error Resume Next
Set myPic = ws.Pictures("LOGO_1")
On Error GoTo 0
---
Regards,
Norman
Tom Ogilvy - 24 May 2006 18:19 GMT
Why do you think that wouldn't work Kevin?
set ws = Activesheet
? typename(ws.Pictures("LOGO_1"))
Picture
However, if this is actually an image control from the Control Toolbox
Toolbar, then it very well might be an OleObject:
? ws.Pictures(2).Name
CommandButton1
? typename(ws.Pictures(2))
OLEObject
In that case, use the OleObjects collection
If you don't know, then you can
Dim OleLOGO as Object

Signature
Regards,
Tom Ogilvy
> No, that doesn't work, or what library reference are you using?
>
[quoted text clipped - 33 lines]
> > > TIA
> > > KM
Kevin McCartney - 24 May 2006 20:34 GMT
The reason why is that I tried the following but got the same error 13 Type
missmatch
Dim pic2 As Picture
Set pic2 = wst.Pictures("DB_LOGO_1") it breaks on this line
so if I declare pic2 as picture and if write in the imediate window
?typename(wst.Pictures("DB_LOGO_1")) I do get "Picture" as trhe returned
value, so my problem is why doesn't it work, why does pic2 not get set to
DB_LOGO_1 when DB_LOGO_1 is located on the worksheet.
TIA
KM
> Why do you think that wouldn't work Kevin?
>
[quoted text clipped - 53 lines]
> > > > TIA
> > > > KM
Kevin McCartney - 24 May 2006 20:53 GMT
Oh.... I knew why there was a reason why I shouldn't program late in the
night, I miss the obvious, since I'm running this from Access in needed to
declare the pic as Excel.Picture and not just Picture.... silly me, oh well
another lesson learnd.
Cheers all
TIA
KM
> The reason why is that I tried the following but got the same error 13 Type
> missmatch
[quoted text clipped - 68 lines]
> > > > > TIA
> > > > > KM