Picture in VB (again)
Posted by Nicke on January 15, 2002 7:30 AM
Since no one answered my last question i try again with a better code snippet. I REALLY must have this to work so I hope someone can help me.
I have a Frame in Excel with a picture. If I type following code in VBA it returns -1056632835 (imgbutton1 is what I've named the frame)
If I try this in VB with following snippet I get an "Automation error" for the Picture property.
'<<START CODE>><p> Dim xl As Excel.Application
Dim img As MSForms.Frame
Dim pic As Object
Set xl = GetObject(, "Excel.Application")
Set img = xl.ActiveSheet.OLEObjects(1).object
'This results in an error...
'<<END CODE>><p>I know img have a correct pointer to the frame because I can for example move the frame from VB. It's just the Picture property that fails.
Thanx in advance.