Hi Everyone,
I am creating an excel file in my vb app. Below is the code I am using to do this. But when the application is closed, I still have an instance of Excel running in the background. How do i close it? I can do it with the xlWBook but not the xlApp. Thanks!
How do I close to get rid of xlApp?Code:'create empty excel file xlApp = CType(CreateObject("Excel.Application"), Microsoft.Office.Interop.Excel.Application) xlWBook = CType(xlApp.Workbooks.Add, Microsoft.Office.Interop.Excel.Workbook) xlWSheet = CType(xlWBook.Worksheets(1), Microsoft.Office.Interop.Excel.Worksheet) ... do stuff here xlWSheet.SaveAs(sFilePath) xlWBook.Close()
Thanks!




Reply With Quote