I have this code to download a file from sharepoint that works Wonderfully!
Now I just want to be able to select a file from a dropdown combobox list that contains all the files to choose from the Sharepoint URL.
Any ideas how this can be done? (kind of like displaying files in a folder location, but a sharepoint url instead)
I asked ChatGPT and it uses a JSONConverter feature that doesn't work!.
Thank you.
Now I just want to be able to select a file from a dropdown combobox list that contains all the files to choose from the Sharepoint URL.
Any ideas how this can be done? (kind of like displaying files in a folder location, but a sharepoint url instead)
I asked ChatGPT and it uses a JSONConverter feature that doesn't work!.
Thank you.
VBA Code:
Sub DownloadFromSharePoint()
Dim sharePointURL As String
Dim FilePath As String
Dim fileName As String
Dim FullPath As String
' SharePoint URL
sharePointURL = "https://......sharepoint.com/sites......../"
' File path on SharePoint (including folder structure)
FilePath = ""
' File name
fileName = "test.xlsx"
' Full path on SharePoint
FullPath = sharePointURL & FilePath & fileName
' Download workbook from SharePoint
Workbooks.Open FullPath
MsgBox "Workbook downloaded from SharePoint successfully!", vbInformation
End Sub
Sub DisplayFilesInFolder()
Dim folderPath As String
Dim folder As Object
Dim file As Object
' Specify the folder path
folderPath = "C:\Users\233166\Desktop\Macro WBs\Backup"
' Create a FileSystemObject
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
' Get the folder object
Set folder = fs.GetFolder(folderPath)
' Loop through each file in the folder and display the file names
For Each file In folder.Files
Debug.Print file.Name
Next file
End Sub