ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Searching through Web Folder (https://www.excelbanter.com/excel-programming/377448-searching-through-web-folder.html)

kmbarz

Searching through Web Folder
 
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%20Deployment/"



All times are GMT +1. The time now is 02:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com