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. COM
  4. Excel.exe is not getting killed implicitly

Excel.exe is not getting killed implicitly

Scheduled Pinned Locked Moved COM
c++testingtoolshelpquestion
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.
  • K Offline
    K Offline
    KTTransfer
    wrote on last edited by
    #1

    Hi, I am working on Excel automation using VC++(unmanaged). imports: #import "libid:00020813-0000-0000-C000-000000000046" auto_search no_dual_interfaces \ rename("DialogBox", "excelDialogBox") \ rename("RGB", "excelRGB") \ rename("DocumentProperties", "excelDocumentProperties") \ rename("SearchPath", "excelSearchPath") \ rename("CopyFile", "excelCopyFile") \ rename("ReplaceText", "excelReplaceText") Following are the two issues: 1. Whenever Excel is closed , Excel.EXE is not getting closed. My application should track opening and closing of Excel. I released application pointer(Excel::_ApplicationPtr) but same problem. I googled and got few solutions, but nothing worked. I tried : Excel::_ApplicationPtr XL. And getting the active object of excel using GetActiveObject. XL->Quit(); XL->Release(); XL = NULL; but none of these worked. Is there any similar method like Marshal.ReleaseComObject in UNmanaged VC++? 2. Is there any callback which tracks excel.exe is closed? Please give me clue to solve these issues. Regards, KTTransfer.

    S 1 Reply Last reply
    0
    • K KTTransfer

      Hi, I am working on Excel automation using VC++(unmanaged). imports: #import "libid:00020813-0000-0000-C000-000000000046" auto_search no_dual_interfaces \ rename("DialogBox", "excelDialogBox") \ rename("RGB", "excelRGB") \ rename("DocumentProperties", "excelDocumentProperties") \ rename("SearchPath", "excelSearchPath") \ rename("CopyFile", "excelCopyFile") \ rename("ReplaceText", "excelReplaceText") Following are the two issues: 1. Whenever Excel is closed , Excel.EXE is not getting closed. My application should track opening and closing of Excel. I released application pointer(Excel::_ApplicationPtr) but same problem. I googled and got few solutions, but nothing worked. I tried : Excel::_ApplicationPtr XL. And getting the active object of excel using GetActiveObject. XL->Quit(); XL->Release(); XL = NULL; but none of these worked. Is there any similar method like Marshal.ReleaseComObject in UNmanaged VC++? 2. Is there any callback which tracks excel.exe is closed? Please give me clue to solve these issues. Regards, KTTransfer.

      S Offline
      S Offline
      serzh83
      wrote on last edited by
      #2

      AFAIK, to close Excel application you have to create it via CoCreateInstance

      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