how to close excel application open by vb.net code. When I quit application in my code.. It still running in task manager.. this is my code
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("sheet1")
.......................write in excel sheet..........
xlWorkBook.SaveAs(filepath, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue)
xlWorkBook.Close(True, misValue, misValue)
xlApp.Quit()
2 Replies - 174 Views - Last Post: 25 January 2013 - 03:53 AM
#1
how to close excel application open by vb.net code.
Posted 25 January 2013 - 02:55 AM
Replies To: how to close excel application open by vb.net code.
#2
Re: how to close excel application open by vb.net code.
Posted 25 January 2013 - 03:14 AM
This should work!
No errors recorded??
Regards,
No errors recorded??
Regards,
#3
Re: how to close excel application open by vb.net code.
Posted 25 January 2013 - 03:53 AM
xlApp = New Excel.ApplicationClass 'should be.. xlApp = New Excel.Application
An old page that discusses this.
excelApp.Workbooks.Close(); excelApp.Quit(); Marshal.ReleaseComObject(xlWorkbook); Marshal.ReleaseComObject(xlSheets); Marshal.ReleaseComObject(xlSheet); Marshal.ReleaseComObject(excelApp);
http://stackoverflow...interop-objects
Good tutorial
This post has been edited by andrewsw: 25 January 2013 - 03:57 AM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|