LoadPicture into UserForm

C

Charlotte E.

Hi,

I have a UserForm, in which I need to import some images from time to time.

Currently I'm using:

Image_3_A.Picture = LoadPicture(Path & Picture)

....which is working fine :)

But I always need to perform some actions before showing the image, so I
figured, I'll do my own UDF, which both does all the action, and as the
last line in the UDF prase the path and picture to the function.

I did the function, called MyLoadPicture, which works fine until the
very last line:

MyLoadPicture = LoadPicture(Path & Picture)

This very last line gives an 'Object required' error!?!

I think it as to do with IPictureDisp object, but how to make it work???

I was kind of hoping to be able to use my function like the normal
'LoadPicture' function, i.e.:

Image_3_A.Picture = MyLoadPicture(Path & Picture)

Thanks in advance,

CE
 
C

Charlotte E.

Stupid me!

Got it!

I forgot to set the object variable...

Sometimes you just can't see the forrest for all them trees :)

Sorry..


CE



Den 01.12.2012 11:48, Charlotte E. skrev:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top