file name and location export

22strider

Active Member
Joined
Jun 11, 2007
Messages
311
Hello Friends

I am using Window XP and need to export file names to a text file.

For my project I need to export names of all the files along with their paths. I need to able to get names of all the files in all the subfolders (sub directories) under a folder along with their paths.

Thanks for your time
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hello Derek

Thanks for your message.

I tried the code given on this link on VBA in Excel 2007; and got error that the object "With Application.FileSearch" is not supported.

Do you have any suggestions for making it work for Excel 2007?

One more thing; I also need to search the sub folders. For that I changed ".SearchSubFolders" to "True".

It seems like this should work but unfortunately the code is not for 2007.

Please let me know if you could modify it.

Thanks
Rajesh
 
Upvote 0
Hello Derek

I tried that code and am getting "User Defined Type not defined error". I see that somebody else had that problem and someone even provided solution. I still cannot make it work. Feeling pretty dumb at this moment.

Could you please have another look?

Thanks
Rajesh
 
Upvote 0
You need to set a reference (Tools | References) to:
Microsoft Scripting Runtime
You do that in the VBE Environment (where you created the VBA code).
Once you have done that, do "Debug | Compile VBAProject" and check that it compiles OK.
 
Upvote 0

Forum statistics

Threads
1,224,559
Messages
6,179,513
Members
452,921
Latest member
BBQKING

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