Forum Discussion
Sharepoint Sync-On-Demand & Application.Path
How about to utilize ThisWorkbook.FullName or ThisWorkbook.Path within your VBA code. These properties typically provide the actual file path, even when the file is locally synced through OneDrive or SharePoint.
- CodeCarpenterApr 27, 2025Copper Contributor
My earlier respone to this disapeared a day later, so hopefully this one sticks around...
I mistakenly wrote "Application.Path" in my initial post - my code actually does already use "ThisWorkbook.Path" and that is what is returning the SharePoint site instead of the expected local file path. This only happens while Sync-On-Demand is enabled, but now it happens always since there is no user-available method of turning it off.
- CodeCarpenterApr 26, 2025Copper Contributor
My apologies - I mistyped my post as "Application.Path" instead of "ThisWorkbook.Path" which is what I am actually using.
ThisWorkbook.Path is returning the SharePoint location, despite opening the file from the HD location. I suspect they are using some sort of Symlink type shenanigans behind the scenes to accomplish (the now hidden) Sync-On-Demand functionality, despite the fact that I specifically do not want this functionality - and it is also breaking my critical business applications in unexpected and undocumented ways.