Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to make an Excel Process...close by itself

How to make an Excel Process...close by itself

Scheduled Pinned Locked Moved ASP.NET
sysadmintutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jagadish_chatarji
    wrote on last edited by
    #1

    Dim FN As String = Server.MapPath("\esmp\temp\" & Session.SessionID & ".xls") Dim xl As New Excel.Application Dim wk As Excel.Workbook = xl.Workbooks.Add() xl.Cells(2, 2) = "its ok" wk.Close(SaveChanges:=True, FileName:=FN) wk = Nothing xl.Quit() xl = Nothing ------------------------------- that was the coding I wrote in the button click event. It does work fine...but it is creating a separate process every time, the event is fired...and the process from task manager could not get deleted automatically. If I click on button 5 times....5 processes named as "EXCEL.EXE" are staying in the processes of TaskManager. So, How to make the process to close byitself after the completion of its work.

    M 1 Reply Last reply
    0
    • J jagadish_chatarji

      Dim FN As String = Server.MapPath("\esmp\temp\" & Session.SessionID & ".xls") Dim xl As New Excel.Application Dim wk As Excel.Workbook = xl.Workbooks.Add() xl.Cells(2, 2) = "its ok" wk.Close(SaveChanges:=True, FileName:=FN) wk = Nothing xl.Quit() xl = Nothing ------------------------------- that was the coding I wrote in the button click event. It does work fine...but it is creating a separate process every time, the event is fired...and the process from task manager could not get deleted automatically. If I click on button 5 times....5 processes named as "EXCEL.EXE" are staying in the processes of TaskManager. So, How to make the process to close byitself after the completion of its work.

      M Offline
      M Offline
      MKlucher
      wrote on last edited by
      #2

      You have to force garbage collection to clean everything up. Check out this link http://discuss.develop.com/archives/wa.exe?A2=ind0108C&L=DOTNET&D=0&m=19532&P=70662[^] or http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q266/0/88.asp&NoWebContent=1[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups