Office Interop - from a windows form how to reestablish connection to a previously started Office application

After restart of a Windows Forms application (crashed due to severe error) how can I reestablish connection to a previously initiated Excel instance which is still existing and
contains important data for the restarted forms application ?

I have a VB.net based Windows forms application which is using Excel in the background for calculations.

I am starting Excel with
    Public Excel_App As Microsoft.Office.Interop.Excel.Application
    Public Excel_WB As Microsoft.Office.Interop.Excel.Workbook
    Public Excel_WS As Microsoft.Office.Interop.Excel.Worksheet
    Dim Filepath As String

    Excel_App = New Microsoft.Office.Interop.Excel.Application
    Excel_App.WindowState = Microsoft.Office.Interop.Excel.XlWindowState.xlNormal
    Excel_App.Visible = False
    Excel_App.DisplayStatusBar = False
   
    Filepath ="C:\Filename.xls"
    Excel_WB = Excel_App.Workbooks.Open(FilePath)
    Excel_WS = Excel_WB.Worksheets("Data")

    <Processing of data on the Excel sheet>

When the foems application is restatred after a crash the code is creating a new instance of Excel which then opens the same file, however this time in read only mode (because the previous instance is still alive).

I like to identify such a case and reestablish connection to the previous Excel instance instead of creating a new one.

I will appreciate any hint on how to do this.
PhyllaxAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Corey ScheichDeveloperCommented:
Excel_App = getobject("Excel.application")
0
Corey ScheichDeveloperCommented:
Here is a pretty good full example. That will create a new instance if one isn't available
http://msdn.microsoft.com/en-us/library/e9waz863(v=vs.71).aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.