Hello
I am having an issue with my code below not closing EXCEL.EXE when I
tell it do. Any help would be appreciated.
-----
Dim excel As Microsoft.Offic e.Interop.Excel .Application
Dim wb As Microsoft.Offic e.Interop.Excel .Workbook
Dim ws As Microsoft.Offic e.Interop.Excel .Worksheet
excel = New Microsoft.Offic e.Interop.Excel .Application
wb = excel.Workbooks .Open(strDynami cFileName)
ws = wb.Sheets.Item( 1)
excel.Visible = False
wb.Activate()
.... REMOVED FUNCTION CODE HERE
' Clean up
System.Runtime. InteropServices .Marshal.Releas eComObject(ws)
ws = Nothing
wb.Close()
System.Runtime. InteropServices .Marshal.Releas eComObject(wb)
wb = Nothing
excel.Quit()
System.Runtime. InteropServices .Marshal.Releas eComObject(exce l)
excel = Nothing
I am having an issue with my code below not closing EXCEL.EXE when I
tell it do. Any help would be appreciated.
-----
Dim excel As Microsoft.Offic e.Interop.Excel .Application
Dim wb As Microsoft.Offic e.Interop.Excel .Workbook
Dim ws As Microsoft.Offic e.Interop.Excel .Worksheet
excel = New Microsoft.Offic e.Interop.Excel .Application
wb = excel.Workbooks .Open(strDynami cFileName)
ws = wb.Sheets.Item( 1)
excel.Visible = False
wb.Activate()
.... REMOVED FUNCTION CODE HERE
' Clean up
System.Runtime. InteropServices .Marshal.Releas eComObject(ws)
ws = Nothing
wb.Close()
System.Runtime. InteropServices .Marshal.Releas eComObject(wb)
wb = Nothing
excel.Quit()
System.Runtime. InteropServices .Marshal.Releas eComObject(exce l)
excel = Nothing
Comment