I have one Excel workbook thats is sync local and online, if a open with onedrive running my excel reconize this workbook how online file, the excel 365 has a option (file>information>copy local path) if a file is also save local.
SendKeys "%ail~"
'this line get the text, end send to clipboard, works one time, but now nothing is send.
Sorry my english.
Sub TestPath()
Dim wb As Workbook
Dim LocalString As DataObject
Dim CamLocalComplete As String 'path file + name file
Dim WorkBookName As String 'name file
Dim CamLocal As String 'must be only local path file
Set LocalString = New DataObject
WorkBookName = ThisWorkbook.Name
Set wb = Workbooks(WorkBookName)
wb.Activate
Application.Wait Now + TimeValue("00:00:01")
'File > Informations > Copy local path
SendKeys "%ail~" 'this line get the text send to clipboard, works one time, but now
Application.Wait Now + TimeValue("00:00:01")
'Back plan
SendKeys "{ESC}"
'Get cliboard text
LocalString.GetFromClipboard
CamLocalComplete = LocalString.GetText
CamLocal = Left(CamLocalComplete, InStrRev(CamLocalComplete, "\") - 1)
Range("E26").Value = CamLocal
End Sub