Hi,
I am trying to get all the workbook names in a list from a SharePoint site, I can do this from a file structure code below, but this does not work with SharePoint, any help would be gratefully appreciated.
Sub LoopThroughFiles()
Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Integer
Dim Path As String
Range("A6:A2000").ClearContents
Path = Range("A3").Value
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(Path)
For Each oFile In oFolder.Files
Cells(i + 6, 1) = oFile.Name
i = i + 1
Next oFile
End Sub
I am trying to get all the workbook names in a list from a SharePoint site, I can do this from a file structure code below, but this does not work with SharePoint, any help would be gratefully appreciated.
Sub LoopThroughFiles()
Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Integer
Dim Path As String
Range("A6:A2000").ClearContents
Path = Range("A3").Value
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(Path)
For Each oFile In oFolder.Files
Cells(i + 6, 1) = oFile.Name
i = i + 1
Next oFile
End Sub