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. General Programming
  3. C#
  4. Closing or ending a process

Closing or ending a process

Scheduled Pinned Locked Moved C#
csharpquestion
7 Posts 3 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.
  • C Offline
    C Offline
    ckruger
    wrote on last edited by
    #1

    I have opened a Excel spreadsheet with c# by using the Excel.Application class. After I have closed the excel file in windows by clicking on the X in the upper right hand corner, the process EXCEL.EXE stil remains.???

    E 1 Reply Last reply
    0
    • C ckruger

      I have opened a Excel spreadsheet with c# by using the Excel.Application class. After I have closed the excel file in windows by clicking on the X in the upper right hand corner, the process EXCEL.EXE stil remains.???

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      Did you click on X of the main form or just close a document ? << >>

      C 2 Replies Last reply
      0
      • E enjoycrack

        Did you click on X of the main form or just close a document ? << >>

        C Offline
        C Offline
        ckruger
        wrote on last edited by
        #3

        Yes, basically the user does...

        C 1 Reply Last reply
        0
        • C ckruger

          Yes, basically the user does...

          C Offline
          C Offline
          ckruger
          wrote on last edited by
          #4

          Sorry! I've clicked on X of the main form.

          E 1 Reply Last reply
          0
          • E enjoycrack

            Did you click on X of the main form or just close a document ? << >>

            C Offline
            C Offline
            ckruger
            wrote on last edited by
            #5

            Sorry! I've clicked on X of the main form.

            M 1 Reply Last reply
            0
            • C ckruger

              Sorry! I've clicked on X of the main form.

              M Offline
              M Offline
              Maqsood Ahmed
              wrote on last edited by
              #6

              Hello, Please try to do this in Closing event of the main form. if(excelApplication != null && excelApplication.Workbooks.Count > 0) { foreach(Workbook wb in excelApplication.Workbooks) { wb.Close(false,Type.Missing,Type.Missing); } excelApplication.Quit(); excelApplication.Visible = false; } where excelApplication is an Excel.ApplicationClass object. HTH. Cheers :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net

              1 Reply Last reply
              0
              • C ckruger

                Sorry! I've clicked on X of the main form.

                E Offline
                E Offline
                enjoycrack
                wrote on last edited by
                #7

                lol, OK ... Happy Coding :rose: << >>

                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