SOLVED

VBA help for importing images from file

New Contributor

Hello,

 

I just started to use VBA and would really appreciate if someone could help me out. I would like to view images according to a path stored in a database. The images should refresh if a value in a specific cell is changed. I already figured out how to import one image according to the database, which is connected to that specific cell through INDEX and MATCH formulas. Unfortunately my knowledge is not enough to write a code which allows to import several images at the same time. Also it seems like sometimes previous images wont get removed and a new image is getting imported on top of the old one. If there is no image at all or no matching path in the database, a run-time error is exposed.

 

Is it even possible to find a clean solution for my problem and import several images at the same time? I would be really thankful if somebody could lead me in the right direction and at least help me deal with the runtime errors. Huge thanks in advance!

 

 

2 Replies

@augejevgenij 

Here is a ready-made proposal from the Internet.

Unfortunately, I can't remember the address, too long ago.

 

It does not work with all image file formats - but jpg, bmp, wmf, emf are possible.

20 images from the directory are loaded into the UserForm and displayed on image controls.

With the scrollbar you can scroll through the images and enter the numbers for the order of the images.

 

Depending on the size of the image files and the power of your computer, the update always takes a few seconds when scrolling.

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

best response confirmed by augejevgenij (New Contributor)
Solution
The problem was solved by a kind user on Stackoverflow:

https://stackoverflow.com/questions/66455317/vba-help-for-importing-images-from-file

Thank You