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 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.