''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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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