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 / C++ / MFC
  4. Need to open an instance of excel in the same process as my main program.

Need to open an instance of excel in the same process as my main program.

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiohardwaretesting
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.
  • R Offline
    R Offline
    Raj Abhishek
    wrote on last edited by
    #1

    My software is an excel plug-in. We are using the C++ unit test framework embedded within Visual Studio to test it. Now, in my C++ unit test-code, when I open excel ( e.g. through shellexecute ), Excel opens up in a separate process and hence, I am not able to test my add-in code in the test process. How do I attach to the excel programatically so that I can follow the behaviour in the same process. It's a unit-test scenario and hence, we are trying to do everything with least manual intervention. Regards, Raj Abhishek

    M 1 Reply Last reply
    0
    • R Raj Abhishek

      My software is an excel plug-in. We are using the C++ unit test framework embedded within Visual Studio to test it. Now, in my C++ unit test-code, when I open excel ( e.g. through shellexecute ), Excel opens up in a separate process and hence, I am not able to test my add-in code in the test process. How do I attach to the excel programatically so that I can follow the behaviour in the same process. It's a unit-test scenario and hence, we are trying to do everything with least manual intervention. Regards, Raj Abhishek

      M Offline
      M Offline
      Melqui Andrade
      wrote on last edited by
      #2

      You need add the Interop.Excel.dll to your project. With that dll you can create a excel application to handle menus, bars, and so on. The documentation is [here]

      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