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!
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!
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.