I've created a VB .Net windows application that generates reports in excel files from a dataset.
I use "New Excel.Application" to create the Excel instance, and push data into it from my dataset. During this process, I do not show the GUI of my instance of Excel to the user, so nobody can tamper with the instance.
Everything works as expected.
Except in one case: When the automation is in progress, if the user opens some other excel file, it opens as a workbook within the Excel instance being used in my application, instead of creating a new Excel instance for the same. In such cases, the automation is exposed, and fails with random exceptions depending on what the user does with it.
So when the automation is in progress, I would like to prevent the user from opening the instance of Excel that I use in my VB application.
How can I prevent this? Is it possible to make my instance of Excel application exclusive to my application alone?