VBA code to list all the workbooks/file names in multiple folders (within another folder)?

Enigmachrysalis

Active Member
Joined
Apr 13, 2009
Messages
352
Office Version
  1. 365
Platform
  1. Windows
So I have ~5 folders with 4-8 files within each. These all reside in another folder location.

Is there a quick snippet of code that will navigate to this location and list the name of the workbook/file?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
.
Not certain what to tell you. The download works as expected here.
 
Upvote 0
No, the download works fine and the file opens without error, but when I paste my folder location, or navigate there using the Browse button it tells me it doesn't exist.
 
Upvote 0
Not getting involved here, but is your folder on
- your C drive?
- a server?
- 3rd party server like OneDrive?
 
Upvote 0
Suggest you test with folder location on C drive - that will probably be OK and behave as expected
If so, you will know that the VBA works and that it's the path to the shared folder that is not being recognised.
 
Last edited:
Upvote 0
Suggest you test with folder location on C drive - that will probably be OK and behave as expected
If so, you will know that the VBA works and that it's the path to the shared folder that is not being recognised.

So I got it to work when I browsed to the intended location. What's odd is that I clicked the 3 types of Excel file extensions to no avail; it seemed to run and listed nothing. However, if i choose al file types it gives me the names of everything down through the subfolders.
 
Upvote 0

Forum statistics

Threads
1,223,975
Messages
6,175,749
Members
452,667
Latest member
vanessavalentino83

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