wir hatten bereits hier einmal eine Lösung ob die ExcelArbeitsmappe lokal gespeichert ist oder eben nicht.
Ich kannmir nicht mehr genau erinnern, ob wir in enem anderen Thread auch schon eine Lösung erbastelt hatten, um einen für Windows lesbaren Pfad zum OneDrive Ordner zu erhalten.
Hier eine Lösung:
Code: Alles auswählen
Function OneDrivePathFixer(strFullPath As String) As String
Dim strOnedrivePart As String
strFullPath = VBA.Replace(strFullPath, "/", "\")
strOnedrivePart = "https:\\d.docs.live.net\"
If InStr(strFullPath, strOnedrivePart) Then
strFullPath = VBA.Replace(strFullPath, strOnedrivePart, "")
strFullPath = Right(strFullPath, Len(strFullPath) - InStr(1, strFullPath, "\"))
strFullPath = Environ("OneDrive") & "\" & strFullPath
End If
OneDrivePathFixer = strFullPath
End Function
?OneDrivePathFixer(ThisWorkbook.FullName)
Viel Spaß damit