Open Excel File And Reusing Existing Excel Instance?Jul 13, 2010
I have an application the contains several excel files bundled with it. I'm not opening the files and processing them within my application. These files contain a data-connection to reload all of the pivot-tables within each excel file. I have a 'link' on my form, that when clicked, it determines which file to open and calls a sub using filename and executing Process.Start(filename) for any excel file I want to open. I have no problems opening any one of the files and then exiting excel.
The problem is when I 'close' a file, but don't exit Excel; then try to open another file(clicking link on form)... it creates a new instance of Excel.
I know from experimenting that the fileopendialog form will 'reuse' an existing Excel instance, IF it does not already have a file open.
How can I do the same thing without using the fileopendialog?
I don't want the end-user to have access to the folders where these files live. That's why I have multiple 'links' on my form, one for each xls that already exists. I just want them to be able to click on a link and the xls file opens AND if they choose to merely 'close' a file and not exit... Don't create a new instance of Excel, but re-use the existing one.