Hi
Could you tell me how to write the vba code to save a copy of the active workbook in sharepoint with the date and keep the active workbook open. A kind of archiving!
I have this work around that I see on the internet that doesn't seem to be final.
Thanks for any help and have a nice day!
Could you tell me how to write the vba code to save a copy of the active workbook in sharepoint with the date and keep the active workbook open. A kind of archiving!
I have this work around that I see on the internet that doesn't seem to be final.
Thanks for any help and have a nice day!
Code:
Sub SharePoint_Save()
Dim acctCode As String
Dim mainpath As String
Dim filePath As String
Dim savefile As String
Dim thiswbpath As String
Dim wb As Variant
ThisWorkbook.Save
thiswbpath = ThisWorkbook.FullName
acctCode= v_Welcome.Range("D5")
mainpath = "https://companyname.sharepoint.com/sites/GROUPA/Shared Documents/General/Auto Save/Full Template/"
savefile = mainpath & acctCode & " FullTemplate auto-saved"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:=savefile, FileFormat:=52
Application.DisplayAlerts = True
Set wb = Workbooks.Open(thiswbpath)
ThisWorkbook.Close False
End Sub