3,267 questions
Here's VBA code to do this:
Sub ChangeToOneDriveFolder()
Dim strPath As String
'Get path from Environment (Type Set in CMD window to see others).
strPath = Environ("OneDrive")
'Change drive letter (I use D for my data files and OneDrive is on the C drive.
ChDrive Left(strPath, 2) & """"
'Set current filder to One Drive.
ChDir strPath
End Sub