VBA: Unable to load picture into image control in UserForm when using Office 2011 for Mac
Posted on 2014-10-04
Programming in VBA in MS PowerPoint 2011 for Mac, I am having trouble loading a picture into a UserForm image control. I have done this successfully hundreds of times in Office 2007 and 2010 for Windows.
After adding the image control to my UserForm, in the Properties pane, I can usually click on Picture, then browse to select a .jpg file on my computer, after which the word (Bitmap) shows in the Properties pane and the picture appears in the image control. But when I try to do this on a Mac, it lets me browse, but all .jpg files are greyed out and not selectable. I have tried cutting and pasting a shortcut to the .jpg directly into the Picture row of the properties pane without success.
I have also tried loading the picture at runtime using a command such as "me.myImageControl.Picture = LoadPicture (myjpg)." But this method, which I've used many times in Windows, generates an error and does not appear to be supported in VBA for the Mac. I tried all this in Word 2011 with the same results, so it's not just PowerPoint.
There must be a way to do this, because the Image control has a Picture property with a browse button.
Any help would be greatly appreciated!