I have an xl file locate in a folder that is on onedrive with available offline checked.
The windows 10 explorer displays "C:\Users\..blabla...\OneDrive - Blabla\MyFiles" in the path bar.
The following code:
Function GetActiveWorkbookPath() As String
Dim wbPath As String
Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
wbPath = Application.ActiveWorkbook.FullName
GetActiveWorkbookPath = fso.GetParentFolderName(wbPath)
Debug.Print fso.GetParentFolderName(wbPath)
Debug.Print ThisWorkbook.Path
Set fso = Nothing
End Function
returns the cloud path:
I would like to use the local path as an error message appear as i try to .savecopy
Does any one have an idea.
The windows 10 explorer displays "C:\Users\..blabla...\OneDrive - Blabla\MyFiles" in the path bar.
The following code:
Function GetActiveWorkbookPath() As String
Dim wbPath As String
Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
wbPath = Application.ActiveWorkbook.FullName
GetActiveWorkbookPath = fso.GetParentFolderName(wbPath)
Debug.Print fso.GetParentFolderName(wbPath)
Debug.Print ThisWorkbook.Path
Set fso = Nothing
End Function
returns the cloud path:
I would like to use the local path as an error message appear as i try to .savecopy
Does any one have an idea.