SharePoint file paths in Office add-ins

%3CLINGO-SUB%20id%3D%22lingo-sub-2127555%22%20slang%3D%22en-US%22%3ESharePoint%20file%20paths%20in%20Office%20add-ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2127555%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EWe%20have%20an%20Excel%20VSTO%20(desktop)%20add-in%20which%20needs%20to%20access%20the%20file%20path%20of%20the%20open%20Workbook.%20(The%20FullName%20property%20of%20the%20Excel%20application%20object%20provides%20this.)%20If%20the%20file%20is%20in%20SharePoint%20and%20synchronised%20to%20a%20local%20folder%20using%20OneDrive%20with%20the%20'use%20Office%20applications%20to%20sync%20Office%20files%20that%20I%20open'%20setting%20enabled%2C%20I%20would%20expect%20the%20file%20path%20to%20be%20the%20SharePoint%20URL%20even%20if%20the%20user%20opens%20the%20Excel%20file%20from%20the%20local%20folder%20using%20File%20Explorer.%20Normally%20this%20works%20but%20a%20few%20users%20have%20reported%20that%20the%20file%20path%20shown%20is%20always%20to%20the%20local%20folder.%20I%20checked%20one%20computer%20and%20made%20sure%20that%20SharePoint%20was%20added%20as%20a%20connected%20service%2C%20the%20latest%20version%20of%20OneDrive%20was%20installed%2C%20OneDrive%20was%20synching%20the%20folder%20and%20the%20aforementioned%20setting%20was%20enabled.%20The%20user%20can%20open%20the%20file%20through%20Excel%20by%20going%20to%20File%20then%20Open%20and%20navigating%20to%20the%20SharePoint%20folder%20and%20again%20afterwards%20by%20clicking%20the%20item%20in%20the%20recent%20files%20list.%20In%20both%20these%20scenarios%2C%20the%20file%20path%20(FullName%20property)%20is%20the%20SharePoint%20URL%20as%20expected.%20It's%20just%20File%20Explorer%20that's%20not%20behaving%20correctly.%20Are%20there%20any%20other%20settings%20in%20Office%2C%20SharePoint%20or%20OneDrive%20that%20might%20override%20the%20expected%20behaviour%20when%20opening%20a%20file%20from%20File%20Explorer%3F%3C%2FP%3E%3CP%3EAny%20suggestions%20welcome!%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EPete%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi,

We have an Excel VSTO (desktop) add-in which needs to access the file path of the open Workbook. (The FullName property of the Excel application object provides this.) If the file is in SharePoint and synchronised to a local folder using OneDrive with the 'use Office applications to sync Office files that I open' setting enabled, I would expect the file path to be the SharePoint URL even if the user opens the Excel file from the local folder using File Explorer. Normally this works but a few users have reported that the file path shown is always to the local folder. I checked one computer and made sure that SharePoint was added as a connected service, the latest version of OneDrive was installed, OneDrive was synching the folder and the aforementioned setting was enabled. The user can open the file through Excel by going to File then Open and navigating to the SharePoint folder and again afterwards by clicking the item in the recent files list. In both these scenarios, the file path (FullName property) is the SharePoint URL as expected. It's just File Explorer that's not behaving correctly. Are there any other settings in Office, SharePoint or OneDrive that might override the expected behaviour when opening a file from File Explorer?

Any suggestions welcome!

Thanks,

Pete

0 Replies