B
BrenB
I want to open an Excel doc from my .NET 2.0 WinForm application.
I have a list of UNC path names of Excel documents a user might want
to open.
The way I'm doing it now works, but when the user closes Excel, it is
still running; I can see it in the list of processes in TaskManager.
My WinForm app open the document this way:
Dim pathname As String = ListBox1.SelectedItem.ToString()
Dim excelApp As Excel.Application
excelApp = New Excel.Application()
excelApp.Workbooks.Open(pathname)
excelApp.Visible = True
excelApp = Nothing
Even though I am setting excelApp to nothing, my WinForm app is
holding on to Excel after the user closes it.
Is there a better approach to opening Excel so that it will close when
the user closes the Excel window?
I have a list of UNC path names of Excel documents a user might want
to open.
The way I'm doing it now works, but when the user closes Excel, it is
still running; I can see it in the list of processes in TaskManager.
My WinForm app open the document this way:
Dim pathname As String = ListBox1.SelectedItem.ToString()
Dim excelApp As Excel.Application
excelApp = New Excel.Application()
excelApp.Workbooks.Open(pathname)
excelApp.Visible = True
excelApp = Nothing
Even though I am setting excelApp to nothing, my WinForm app is
holding on to Excel after the user closes it.
Is there a better approach to opening Excel so that it will close when
the user closes the Excel window?