Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Link image in form to a source

0

Dear Experts,

Can we link the image in a user form to a source like a folder (or a cell in an excel sheet could be better) so that the image in the form changes when the image in the source changes?

Thanks for your valuable suggestions!

File

Answer
Discuss

Discussion

If it's from a folder, just put a new image in there with the name of the original one and overwrite the original one. I'm not certain if that works, but have you tried that?
don (rep: 1989) Aug 13, '18 at 4:56 am
I would like to request you to check the file attatched recently.

Thanks for your response!

(N.B. The coding for a web link in my question above appeared different [not embeded] to me.)
Chhabi Acharya (rep: 111) Aug 16, '18 at 9:01 pm
Add to Discussion

Answers

1
Selected Answer

The sub ShowFrmImage in the FormCall standard code module is at the heart of the solution implemented in the attached workbook. I added a lot of comment for your guidance. Note that there is code also in the ThisWorkbook module and in the code sheet of the form DisplayImage.

When you open the attached workbook the Workbook_Open procedure in the ThisWorkbook module will run. When you do this for the first time you will get an error message because cell A10 in Sheet 1 doesn't hold a valid file path. After entering a valid path your form will be shown whenever the workbook is opened. You can also show it by running the sub by some other means.

The code in the form's own code sheet is explained in the comments of the sub ShowFrmImage.

Discuss

Discussion

I'm sure my method will never meet the purpose. Please help checking the file attatched recently. Thank you.
Chhabi Acharya (rep: 111) Aug 16, '18 at 8:53 pm
I can't access your file. Please upload it to this site.
Variatus (rep: 4889) Aug 17, '18 at 5:25 am
I think I've mentioned this problem in one of my previous questions that I seem unable to upload files here, don't know why. Could you paste the following link in your address bar please?-
goo.gl/QufByd
Chhabi Acharya (rep: 111) Aug 17, '18 at 9:14 am
I don't have access to Google sites. However, I have asked Don for assistance.
Variatus (rep: 4889) Aug 17, '18 at 10:10 pm
This is not related to a google site but just a link to box cloud storage. Sorry to learn that my supposition - anyone can access it - is wrong.
Chhabi Acharya (rep: 111) Aug 17, '18 at 11:26 pm
Your link takes me to https://chrome.google.com/webstore/detail/googl-url-shortener
Perhaps, if you have a complete, traditional link it might be different. Resolving the shortened link seems to require a service provided by Google. However, most of the online storage facilities are also used to store pornography and other semi-legitimate files and may be blocked in some countries for that reason. Such blockage would apply to the entire site, not individual files which are perfectly OK, such as your workbook. For such purposes this site is the better alternative and not blocked by anyone. Let's see if Don can help you get proper access.
Variatus (rep: 4889) Aug 17, '18 at 11:40 pm
Thanks for your detailed help! Really the thing I was searching for!
Chhabi Acharya (rep: 111) Aug 20, '18 at 9:43 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login