Click here to Skip to main content
15,907,687 members

Comments by Member 9565931 (Top 10 by date)

Member 9565931 18-Apr-13 6:08am View    
I had envisaged to do this, but I would have preferred a solution that does not cause the close of Excel files.
Member 9565931 18-Apr-13 5:58am View    
It doesn't quite fiy my problem. Let me tell you more details :

I use the WebBrowser component. This allows me to open an Excel file in my application. It works like a web browser: I Navigate ("C:. ... / File.xlsx"), and I catch the event of the end of loading, and I recovered the instance of excel with this code:

var obj = (WebBrowser)_webBrowser.ActiveXInstance;
object doc = obj.Document;
XlWorkBook = (Workbook)doc;
XlApplication = XlWorkBook.Application;

However, I have no control over the behavior of the component. If Excel is already open, it will open the workbook in this instance. But I wish it opens every time in a NEW instance.
Member 9565931 18-Apr-13 5:54am View    
The "by hand" don't really matter.
I use the WebBrowser component. This allows me to open an Excel file in my application. It works like a web browser: I Navigate ("C:. ... / File.xlsx"), and I catch the event of the end of loading, and I recovered the instance of excel with this code:

var obj = (WebBrowser)_webBrowser.ActiveXInstance;
object doc = obj.Document;
XlWorkBook = (Workbook)doc;
XlApplication = XlWorkBook.Application;


However, I have no control over the behavior of the component. If Excel is already open, it will open the workbook in this instance. But I wish it opens every time in a NEW instance.
Member 9565931 18-Apr-13 5:20am View    
I saw that you could force open a new instance by default by modifying the registry, but this is not quite what I want. I want a certain instance of Excel must to be one in which open Excel files by default.
Member 9565931 18-Apr-13 5:19am View    
This is not really what I want to do.
What I want is that Excel files opened "by hand" open by default in my own Excel instance I created.