G
Geoff
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.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
excel = New Microsoft.Office.Interop.Excel.Application
wb = excel.Workbooks.Open(strDynamicFileName)
ws = wb.Sheets.Item(1)
excel.Visible = False
wb.Activate()
.... REMOVED FUNCTION CODE HERE
' Clean up
System.Runtime.InteropServices.Marshal.ReleaseComObject(ws)
ws = Nothing
wb.Close()
System.Runtime.InteropServices.Marshal.ReleaseComObject(wb)
wb = Nothing
excel.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(excel)
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.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
excel = New Microsoft.Office.Interop.Excel.Application
wb = excel.Workbooks.Open(strDynamicFileName)
ws = wb.Sheets.Item(1)
excel.Visible = False
wb.Activate()
.... REMOVED FUNCTION CODE HERE
' Clean up
System.Runtime.InteropServices.Marshal.ReleaseComObject(ws)
ws = Nothing
wb.Close()
System.Runtime.InteropServices.Marshal.ReleaseComObject(wb)
wb = Nothing
excel.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(excel)
excel = Nothing