Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default LoadPicture into UserForm

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default LoadPicture into UserForm

You need to post the code of the procedure MyLoadPicture.

RBS


"Charlotte E." wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default LoadPicture into UserForm

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:
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LoadPicture command Drew[_12_] Excel Programming 1 May 25th 11 08:26 AM
LoadPicture fails kirkm[_8_] Excel Programming 3 April 17th 09 04:28 AM
LoadPicture compile error Jim[_7_] Excel Programming 1 December 20th 07 11:17 PM
LoadPicture for a ControlButton help micmacuk Excel Programming 7 May 30th 06 08:44 PM
LoadPicture - how to keep .jpg compression No Name Excel Programming 0 May 25th 04 08:14 AM


All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"