Inserting images from online folders without knowing the file name - VBA

matcunni

New Member
Joined
Feb 6, 2016
Messages
9
Hi all! I'm having some trouble trying to recover a number of images from an online server.

I can manage to insert an image knowing it's absolute path + filename, but I just know the path.. The name of the *.jpg that's inside each folder is arbitrary, I just know that inside each directory there's just one jpg.

Each image path is obtained like this:
+"http://server.com/camaras/camara" & A4 & "/" & C1 & "/001/jpg/" & C2

Where in Column A is the camera number, in C1,D1,E1,, the day and in C2,D2,D3 the hour/minutes.

jiD0pzo.jpg



Here's an attachment of one of the folders I need to recover the .jpg from

kcgrLQY.jpg


I was trying to learn how to query each folder's content, get the name of the .jpg that's inside and insert it in the corresponding column/row.

As each folder's path is built with a text string plus the camera number in column A plus the contents of C1 and C2, D1 and D2, etc.. I was thinking of assembling the path inside the macro itself in a loop, adding the filename + extension to it and just insert the images where the folders links are, in the first attached picture.

Any kind of guidance is really appreciated!!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top