Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
LoadPicture command | Excel Programming | |||
LoadPicture fails | Excel Programming | |||
LoadPicture compile error | Excel Programming | |||
LoadPicture for a ControlButton help | Excel Programming | |||
LoadPicture - how to keep .jpg compression | Excel Programming |