Searching through Web Folder

K

kmbarz

We have a series of spreadsheets set up in a sharepoint web folder on our
intranet. I would like to be able to use VBA to access this folder,
determine which workbook is the most recent and then open it and continue my
processing. So, I have some code posted on this forum to search a folder and
list subfolders. The question is, what would I do differently here if the
access method has to be http?

Sub Finddir(DataPath)
Dim test As Object
Dim FSO As Object
Dim fDir As Object
Dim fSubDir As Object
Dim i As Long
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fDir = FSO.GetFolder(DataPath)
For Each fSubDir In fDir.SubFolders
i = i + 1
Cells(i, "A").Value = fSubDir.Name
Next fSubDir
End Sub

where Datapath is something like

DataPath = "http://intranet/sites/Data/Product Deployment/"
 

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