Ainsley Rood
asked on
Embeded Images
Hi, Please Please help, I'm stuck and frustrated by what must be a simple thing to overcome! I thought Mr Google has the answer to everything, but today he's falling short!
I'm nearly finished creating a workbook for a customer which contains lots of VBA and a couple of input/update forms. To make the forms look nicer I added their company logo within an image component on said forms. During development I added a basic load image statement in the form initialisation event: imgLogo.Picture = LoadPicture("T:\STORES\Log o.jpg"). Works great, however, I don't want to impose that they need to have this image file is any specific path on the file system. I was hoping I can embed the image in the workbook itself and somehow reference it from within.
I'm nearly finished creating a workbook for a customer which contains lots of VBA and a couple of input/update forms. To make the forms look nicer I added their company logo within an image component on said forms. During development I added a basic load image statement in the form initialisation event: imgLogo.Picture = LoadPicture("T:\STORES\Log
ASKER
Thanks Ramin, Appreciate the help - Unfortunately, the image needs to be used within a VBA Form rather than a worksheet. As you don't seem to be able to apply an image to an image control at design time it's not shipped within the workbook. Thank you
Instead of Loading picture from any path in your VBA, try to Insert Logo in UserForm
ASKER
Thanks Shums, sounds interesting. The only thing available on my toolbox / insert menus is an image control. When you say to insert a logo, how would I go about that? Is that a different object from an image / If so, to I need to add additional references or use "more controls"?
Kindly note, the logo should be in bmp format
ASKER
What happens when you click those "..."
Once you embed image in userform, you don't need to add in initialize.
Check this link where it explains both ways of loading image to userform and assigning with path.
Hope this helps.
Hope this helps.
ASKER
Hi All,
Shums has managed to take my workbook, set an picture to my image control and return it to me... and I can see the picture in design time. Problem is, I cant change it / set it... The "..." button appears to do nothing.
The Image control is:
Microsoft Forms 2.0 Image
And my IDE states:
MS Visual Basic for Applications 7.1
Version: 1056
VBA: Retail 7.1.1056
Forms3: 16.0.7571.7095
Shums has managed to take my workbook, set an picture to my image control and return it to me... and I can see the picture in design time. Problem is, I cant change it / set it... The "..." button appears to do nothing.
The Image control is:
Microsoft Forms 2.0 Image
And my IDE states:
MS Visual Basic for Applications 7.1
Version: 1056
VBA: Retail 7.1.1056
Forms3: 16.0.7571.7095
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great Stuff, thanks for all your help. I'm sure there must be an IDE bug, but copy and paste formed a great workaround. Really Appreciated. Thanks
Right-click the form and select Properties, then look for the Picture property
https://support.office.com/en-us/article/Add-or-remove-a-sheet-background-3577a762-8450-4556-96a2-cc265abc00a8?ui=en-US&rs=en-US&ad=US&fromAR=1