Browse to select a folder

O

Otto Moehrbach

Excel 2003-2007
An OP posted a problem and I realized that there was one thing I needed to
know before I could help him. What is the code to allow the user to select
a folder? The result must be the full path to that folder. Note: That
path will not be the path to ThisWorkbook. Thanks for your time. Otto
 
R

Ron de Bruin

See a example in the macro on this page
http://www.rondebruin.nl/csv.htm

'Browse to the folder with CSV files
Set oApp = CreateObject("Shell.Application")
Set oFolder = oApp.BrowseForFolder(0, "Select folder with CSV files", 512)
If Not oFolder Is Nothing Then
foldername = oFolder.Self.Path
If Right(foldername, 1) <> "\" Then
foldername = foldername & "\"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top