floggingmolly
Board Regular
- Joined
- Sep 14, 2019
- Messages
- 167
- Office Version
- 365
- Platform
- Windows
I have a file on our sharepoint site that we need to download often. Our sharepoint wont let me direct download it so I am trying to open it, then save it to the folder where my workbook is located. It's wanting to save it as a file named FALSE.xlsx and I'm not sure what I am doing wrong. Any help would be appreciated.
Code:
Sub Test()
Dim LocalFilePath As String
Range("A1").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Workbooks.Open Filename:= _
"https://myfedex.sharepoint.com/teams/ourteam/myfile.xlsx"
ActiveWindow.Visible = False
Windows("myfile.xlsx").Visible = _
True
ActiveWorkbook.SaveAs Filename:= _
LocalFilePath = ActiveWorkbook.Path & "\myfileupdate.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
End Sub
[\code]