I am having an issue with finding the local path of my Excel file on disk when synced with OneDrive.
Here is the context: I have an Excel file on my local machine that is also synced with OneDrive. When I try the formula CELL("filename") in Excel I get the https link returned instead of the local path (C:/.../).
I need to access the local path information from my Visual Basic code. What I have is a Microsoft.Office.Interop.Excel._Workbook object. Whenever I try to return Microsoft.Office.Interop.Excel._Workbook.Path I get the https link to OneDrive instead of the local path of my currently opened Workbook. Does there exist an API call to Excel that would return me the local path instead of the URL? I saw solutions involving writing some code to recover the local path from the URL but I do not want to do that to prevent any problems in the future. Or is there an alternative to recover the information I want?
Thank you for your help!