View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default How to look for the Folder Path using macro????

Hi Jac

You can browse to the folder you want

Dim Fld As Object
Dim foldername As String
Set Fld = CreateObject("Shell.Application").BrowseForFolder( 0, "Select folder", 512)
If Not Fld Is Nothing Then
foldername = Fld.Self.Path
If Right(foldername, 1) < "\" Then
foldername = foldername & "\"
End If
End If

Now you can use foldername ib you save path



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Jac" wrote in message ...
Hi,

I would like to save some files in a particular folder, for example
(Ven_Folder) in my computer system; but this folder may be transffered to
another directory time after time. So instead of using the absolute path to
fix the file saving location; I would pretty much wish that there could have
a way the macro can help to lookup for the folder path before those mentioned
files are saved.

I have tried out the Dir statement but it can only work in the 1st loop in
looping control structure. Thus, anyone can help in this matter.......????

Thanking in advanced.