Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA search a web folder for filenames?

Status
Not open for further replies.

knifey

Technical User
Nov 14, 2006
180
GB
Hi,
I'm trying to get a web folders contents so I can download any images that match a partial filename in my workbook (I'm not sure it's even possible in VBA).
This is my code so far but it falls over at strPath with "path not found":

Sub getWebFolderContents(strPath)
Dim objFSO, objFldr
Dim objFl
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFldr = objFSO.GetFolder(strPath)
For Each objFl In objFldr.Files
Debug.Print objFl.Name
Next
Set objFSO = Nothing
Set objFldr = Nothing
End Sub

Any advice or pointers would be much appreciated.
Thanks,
K
 
it falls over at strPath with "path not found"
And what is the value of strPath ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
What am I doing wrong?
The FSO can't deal with URL but UNC.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,
Oh dear, is there a way to convert a url to a unc in vba? Or would I need to contact the website owner to find out the full unc path of where the files are kept?
Thank,
K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top