How does one create a path to save to a SharePoint location?
I am creating this for someone so I have no way to test this. Basically I just want to know if the structure (ActiveWorkbook.SaveAs sPath & "/" & sFile, FileFormat:=51) I am using is correct? IOW: Must the path be defines as a web path or is there any changes I need to know about?
TX
Code: Select all
sInv = Worksheets("Inv").Range("D17").Value
Set rF = Worksheets("InvDue").Range("B:B").Find(What:=sInv, LookAt:=xlWhole)
sPath = "https://abc.sharepoint.com/Finance/Inv"
sFile = Replace(rF.Offset(0, -1) & "_" & rF.Offset(0, 13) & "_INVOICE_" & UCase(Format(rF.Offset(0, 3), "DD-MMM-YYYY")) & "_" & rF.Offset(0, 1) & ".xlsx", " ", "_")
Application.ScreenUpdating = False
...
...
ActiveWorkbook.SaveAs sPath & "/" & sFile, FileFormat:=51 'I changed the usual backslash to a forward slash? Not sure if that is right?
ActiveWorkbook.Close False
Application.ScreenUpdating = True