I'm making a userform to run on both Mac and PC. The form does stuff with pictures, and since certain functions don't exist in the Mac VBA, I identify which platform is running and the proper code is used.
However, when trying to use LoadPicture() to put an image in the userform image control in Windows Excel 2013, I get the same compiler error as when I tried to use it in Mac Excel 2011, "Compiler Error: Sub or Function not defined"
This is strange, as I'm using the function based on syntax at the microsoft website. It's a known issue that LoadPicture doesn't work in Mac, but why should this be happening with the windows version? Did they remove LoadPicture in Office 2013 or replace it with something else?
I know I can to get around this with the PastePicture method by Stephen Bullen, but I'd like to avoid having to install custom stuff.
Here's the line of code I'm using, where Picture1 is a string containing the full path and filename of the picture to be loaded, and pictureWindow is the image control in the userform:
After the compiler error is thrown, "LoadPicture" is highlighted.
Any help is appreciated.
Thanks,
Tim
******** type="cosymantecnisbfw" cotype="cs" id="SILOBFWOBJECTID" style="width: 0px; height: 0px; display: block;">******** type="cosymantecnisbfw" cotype="cs" id="SILOBFWOBJECTID" style="width: 0px; height: 0px; display: block;"></object>
However, when trying to use LoadPicture() to put an image in the userform image control in Windows Excel 2013, I get the same compiler error as when I tried to use it in Mac Excel 2011, "Compiler Error: Sub or Function not defined"
This is strange, as I'm using the function based on syntax at the microsoft website. It's a known issue that LoadPicture doesn't work in Mac, but why should this be happening with the windows version? Did they remove LoadPicture in Office 2013 or replace it with something else?
I know I can to get around this with the PastePicture method by Stephen Bullen, but I'd like to avoid having to install custom stuff.
Here's the line of code I'm using, where Picture1 is a string containing the full path and filename of the picture to be loaded, and pictureWindow is the image control in the userform:
Code:
pictureWindow.Picture = LoadPicture(Picture1)
After the compiler error is thrown, "LoadPicture" is highlighted.
Any help is appreciated.
Thanks,
Tim
******** type="cosymantecnisbfw" cotype="cs" id="SILOBFWOBJECTID" style="width: 0px; height: 0px; display: block;">******** type="cosymantecnisbfw" cotype="cs" id="SILOBFWOBJECTID" style="width: 0px; height: 0px; display: block;"></object>