''Global'' Sharepoint VBA file access

averageProg

New Member
Joined
Apr 6, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello all,
My issue is related to Global Sharepoint.
Previously I was able to access via "normal" sharepoint a list of files by:
a.) dropping the http:
b.) reversing the / to \

Any working solutions or ideas to resolve my code?

In example:
Loc refers to a cell with Sharepoint Path (folder)
The Code pulls all file names from that sharepoint "folder" then places file names on consecutive cells to starting excel doc (which contains this code)

(Original) "old" sharepoint path (ex.) : http://Website.com/sites/Loc/UpFolder/Source
(Amended) "old" sharepoint path (ex.) : \\Website.com\sites\Loc\UpFolder\Source

(Original) GLOBAL "new" sharepoint path (ex.) : https://globalplace.sharepoint.com/sites/path123/Folder
(Attempted amend -- not working) ex. : \\globalplace.sharepoint.com\sites\path123\Folder

VBA Code:
Private Sub LoopThroughFiles()
 
Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Integer
Dim imgLOC As String
 
i = 1
 
Set oFSO = CreateObject("Scripting.FileSystemObject")

Loc = Sheets("filenames").Range("F1").Value
Set oFolder = oFSO.GetFolder(Loc)

For Each oFile In oFolder.Files
 
    Cells(i + 1, 6) = oFile.Name
 
    i = i + 1
 
Next oFile
 
End Sub
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top