Finding Files Using VBA

manrav

New Member
Joined
Aug 19, 2002
Messages
14
Is there a way to find out which drive and directory a particular file is in. I would like to be able to do this through VBA. All I need is to be able to capture the drive letter and the folder that a particular file is in and save it.
Any Ideas.....?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

manrav

New Member
Joined
Aug 19, 2002
Messages
14
Thanks Paddy,
But how do I get it to search for the file using multiple drives. Can I search for the file in drives c:,D,and F at the same time?

Also I don't need to open the file I just need to be able to store the Drive Letter and path as string.

Any Help Greatly appreciated..
Thanks..
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
any file, or are you looking to return the addres of the current file?

Paddy
 

Forum statistics

Threads
1,144,254
Messages
5,723,269
Members
422,489
Latest member
MyForcey

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
Top