How to kill the instance of Excel when we read Excel files in asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aspdotnet88
    • Oct 2007
    • 1

    How to kill the instance of Excel when we read Excel files in asp.net

    Imports System.Runtime. InteropServices .Marshal
    Imports System.Componen tModel.Componen t
    Imports System.Diagnost ics

    Dim _excel = New Excel.Applicati on() ' create a new COM object for excel
    Dim workbook As Excel.Workbook = _excel.Workbook s.Open("C:\Pawa n\Project\prjIn tranetPortal\Ex cel files\QAGAudit PSLinks 18-Sep-07")
    Dim wsSummary As Excel.Worksheet
    wsSummary = _excel.Workshee ts(2)
    Dim STR2 As String = fnGetCellValueT ext("PrjName", wsSummary)
    wsSummary = Nothing
    ReleaseComObjec t(wsSummary)
    workbook = Nothing
    _excel.Quit()
    ReleaseComObjec t(workbook)

    _excel = Nothing

    ReleaseComObjec t(_excel)
    System.GC.Colle ct()



    for nice articles for sql server read http://www.sqlserverquestions.blogspot.com
    Last edited by aspdotnet88; Oct 23 '07, 11:43 AM. Reason: Not working properly
Working...