Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
does Excel has any API that my C# code can invoke to identify if anyone is reading a shared Excel file
We have a Windows 2016 virtual server that is running with OneDrive service. The OneDrive is used to sync the Excel files stored in the Corp SharePoint. We are developing C# code on the virtual server. The purpose of the code is to read/write from/to an Excel file located in the OneDrive. The problem is that at the time of code running, if there is one or more users are reading/writing from/to the Excel file from SharePoint or from their own OneDrive (installed in their own laptops), the OneDrive in the virtual server would show sync error. This causes all users are not able to see the updates done by our code. So my question is that does Excel has any API that my C# code can invoke to identify whether anyone is reading/writing from/to the shared Excel file or not. By identifying this, our code can determine if continue to run OR notify the user to quit the Excel file. see attachment for illustration for easy read.
Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.