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. Communicating with Excel (VC++ 6.0 MFC)

Communicating with Excel (VC++ 6.0 MFC)

Scheduled Pinned Locked Moved COM
c++comtutorialtestingtools
4 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.
  • S Offline
    S Offline
    shibble
    wrote on last edited by
    #1

    Hi, i wrote an application which can communicate with excel. I have build an dialog based project with automation. The next step was including the classes from a Type Library (Excel.exe). Now i can start excel via m_pApp.CreateDispatch("Excel.Application"); and select Ranges and Fill Cells. My Question is: How to communicate with excel without starting excel.exe (in Taskmanager as an proccess). Is it possible to do this. I heard a lot of COM i always thought automation means COM. My C++ Skills are not the best. I won´t use ActiveX elements in my Project. Is there any tutorial or can anybody help me to communicate with excel without starting a excel.exe proccess. Thx in advance. Sorry for bad english. Bye

    D 1 Reply Last reply
    0
    • S shibble

      Hi, i wrote an application which can communicate with excel. I have build an dialog based project with automation. The next step was including the classes from a Type Library (Excel.exe). Now i can start excel via m_pApp.CreateDispatch("Excel.Application"); and select Ranges and Fill Cells. My Question is: How to communicate with excel without starting excel.exe (in Taskmanager as an proccess). Is it possible to do this. I heard a lot of COM i always thought automation means COM. My C++ Skills are not the best. I won´t use ActiveX elements in my Project. Is there any tutorial or can anybody help me to communicate with excel without starting a excel.exe proccess. Thx in advance. Sorry for bad english. Bye

      D Offline
      D Offline
      darkbyte
      wrote on last edited by
      #2

      Communicating with Excel.Application requires that excel be started. If your issue is that this application is visible, then you can probabaly find a visibility method in excel itself. It should be something like m_pApp->SetVisible(false), althought i'm pretty sure my syntax isnt the right one. Other than that, there is a package that is being sold that allows to manipulate excel at the file level but its not free. Can't remember the package name thought.

      S 1 Reply Last reply
      0
      • D darkbyte

        Communicating with Excel.Application requires that excel be started. If your issue is that this application is visible, then you can probabaly find a visibility method in excel itself. It should be something like m_pApp->SetVisible(false), althought i'm pretty sure my syntax isnt the right one. Other than that, there is a package that is being sold that allows to manipulate excel at the file level but its not free. Can't remember the package name thought.

        S Offline
        S Offline
        shibble
        wrote on last edited by
        #3

        Hi darkbyte, thx for reply!!! Your code is totaly correct ->SetVisible(true) If i dont use: ->SetVisible(false) Excel is hidden and not visible @ the Taskbar but i can see it in the Taskmanager as an active process. If i use: ->SetVisible(true) Excel appears in the Taskbar and is started as proccess and application in Taskmanager. My Question is: Is it possible to communicate with excel without having an running excel.exe proccess? I thought COM doesnt need an active procces to communicate. Thx darkbyte maybe anybody else can help too.

        D 1 Reply Last reply
        0
        • S shibble

          Hi darkbyte, thx for reply!!! Your code is totaly correct ->SetVisible(true) If i dont use: ->SetVisible(false) Excel is hidden and not visible @ the Taskbar but i can see it in the Taskmanager as an active process. If i use: ->SetVisible(true) Excel appears in the Taskbar and is started as proccess and application in Taskmanager. My Question is: Is it possible to communicate with excel without having an running excel.exe proccess? I thought COM doesnt need an active procces to communicate. Thx darkbyte maybe anybody else can help too.

          D Offline
          D Offline
          darkbyte
          wrote on last edited by
          #4

          Most Automation Application will be running when you create an instance of them in your application. The reason being that for most operations to be performed, excel need to be running. This makes things a little complex sometimes. Like trying to do something that pops a dialog box only when certain conditions are met. Then the excel application seems like it is stale, but its waiting for a user to click on the "OK" button of the dialog it just popped. Same applies to most members of MS Office family. So, its a definitive NO, you cannot communicate with Excel without having a running excel.exe COM Automation does require to have an active process. This of it this way: if you start your program 3 times, you will have 3 different Excel applications running, and this is a good thing. You dont want a process intensive task to prevent your 2 other programs to wait when all they do is a simple task each.

          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