I have a list of imported hyperlinks, where each hyperlink opens a Document from a Sharepoint site. We no longer are going to use the Sharepoint site so I need a quick way of moving all the documents from sharepoint to folder. (The owner of sharepoint site has left and I do not have permission to DL all the files, or cant think of any other way).
I have created this coding, but am getting Run time error 1004 ; file format is not valid. Does anyone know how to fix or a better solution?
Edit: the coding falls over on Set Wb = Workbooks.Open(HL.Address)
TIA!
Sub Test()
Dim Wb As Workbook
Dim folder As String
Dim HL As Hyperlink
Dim r As Range
folder = "C:UsersM****Desktop"
Set r = Range("A2:A200")
For Each HL In r.Hyperlinks
Set Wb = Workbooks.Open(HL.Address)
Wb.SaveAs folder & ActiveWorkbook.Name
Wb.Close True
Set Wb = Nothing
Next
End Sub
question from:
https://stackoverflow.com/questions/65842675/coding-for-mass-download-from-sharepoint 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…