Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
337 views
in Technique[技术] by (71.8m points)

vba - Coding for Mass Download from Sharepoint

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...