Hello
I had help from this group many years ago and all worked perfect , however, the company has now moved to 365 and the macro does not now run - it stops at the save section. I have recorded a macro using the function in excel. I require the VBA to save to the desktop on any pc by any users
Old Code
Dim strUser As String
strUser = Environ("UserName")
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\" & strUser & "\Desktop\Carrier Files\Book1.xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
New Recorded code - using the record function excel 365
ChDir _
"C:\Users\username\OneDrive\OneDrive - CompanyName\Desktop\Carrier Files"
ActiveWorkbook.SaveAs Filename:= _
"https://compantnamel-my.sharepoint....me/Documents/Desktop/Carrier Files/Book1.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Any help/direction will be appreciated
Many thanks
Brian
I had help from this group many years ago and all worked perfect , however, the company has now moved to 365 and the macro does not now run - it stops at the save section. I have recorded a macro using the function in excel. I require the VBA to save to the desktop on any pc by any users
Old Code
Dim strUser As String
strUser = Environ("UserName")
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\" & strUser & "\Desktop\Carrier Files\Book1.xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
New Recorded code - using the record function excel 365
ChDir _
"C:\Users\username\OneDrive\OneDrive - CompanyName\Desktop\Carrier Files"
ActiveWorkbook.SaveAs Filename:= _
"https://compantnamel-my.sharepoint....me/Documents/Desktop/Carrier Files/Book1.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Any help/direction will be appreciated
Many thanks
Brian