0
votes

I am using Excel Interop inside my C# Desktop Application to open a hidden Excel Application in the Background, which reads data of some Excel files.

Works fine so far, until the user opens his own workbooks with the Windows Explorer. His Workbooks are opened in my Excel Application, which gets visible and the hidden workbooks too. Then he can close the Application, which crashes my Process.

Is there any possibility to get my Excel application blocked, so the user gets his own Excel Application if he opens workbooks?

1

1 Answers

0
votes

Not exactly answering your question, but you can try using the OpenXML SDK to read the contents of the Excel files. Using this SDK, you won't be launching any instance of Excel at all.

Have a look at the following links for reference

https://msdn.microsoft.com/en-us/library/office/cc823095.aspx

https://msdn.microsoft.com/en-us/library/office/gg575571.aspx