I have a macro (assigned to a button in a worksheet) that saves a filtered worksheet to the user’s desktop. The userpath for the user has recently changed. I have not been able to revise my code properly go to the new location.
The previous code was:
Dim userpath As String
Dim acell2 As String
acell = Replace(acell, “/”, “”)
userpath = Environ(“UserProfile”) & “\Desktop\” & acell & “.xlsb”
ActiveWorkbook.SaveAs Filename:=userpath, FileFormat:=xlExcel12
ActiveWorkbook.Close
Application.Workbooks(“2022 SPD Tracker”).Activate
The new path, however, is:
C:\Users\CottoLis\OneDrive – CompanyName\Desktop
What am I missing?
Thanks in advance!!
Lisa
The previous code was:
Dim userpath As String
Dim acell2 As String
acell = Replace(acell, “/”, “”)
userpath = Environ(“UserProfile”) & “\Desktop\” & acell & “.xlsb”
ActiveWorkbook.SaveAs Filename:=userpath, FileFormat:=xlExcel12
ActiveWorkbook.Close
Application.Workbooks(“2022 SPD Tracker”).Activate
The new path, however, is:
C:\Users\CottoLis\OneDrive – CompanyName\Desktop
What am I missing?
Thanks in advance!!
Lisa