OneDrive下的ThisWorkbook.Path
Dim strPath As StringIf InStr(ThisWorkbook.Path, "https://myoffice") > 0 ThenstrPath = Environ("OneDrive") & Mid(ActiveWorkbook.Path, Application.Find("@", Application.Substitute(ActiveWorkbook.Path, "/", "@", 6)), 999)strPath = Replace(strPath, "/", "\")ElsestrPath = ThisWorkbook.PathEnd IfstrPath = strPath & "\"