Forum Discussion
CodeCarpenter
Apr 25, 2025Copper Contributor
Sharepoint Sync-On-Demand & Application.Path
A few years back I traced some weird VBA Macro code behavior in Excel back to a SharePoint feature called "Sync-On-Demand". When Sync-On-Demand is turned on, the VBA code "Application.Path" no longer...
Kidd_Ip
Apr 26, 2025MVP
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.
CodeCarpenter
Apr 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.