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. Using MS Excel in VC++

Using MS Excel in VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 Posts 5 Posters 1 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.
  • Q Offline
    Q Offline
    QSMZ
    wrote on last edited by
    #1

    Hi I want to use MS Excell in VC++ program for recording and plotting data. Should I use CRecordSet Class or else. If yes, can I have some example program for it? Regards

    C R S S 4 Replies Last reply
    0
    • Q QSMZ

      Hi I want to use MS Excell in VC++ program for recording and plotting data. Should I use CRecordSet Class or else. If yes, can I have some example program for it? Regards

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      As far as I know, the CRecordset class is used when you are working with databases. In your case, you have to use Excell automation, search on CP and google for it and you'll find a lot of tutorials.

      QSMZ wrote:

      I want to use MS Excell in VC++ program for recording and plotting data.

      You mean that your program should create an excell file and write data in it then create a chart in the excell file ? If yes, I think this should be feasible through automation.

      Cédric Moonen Software developer
      Charting control [v3.0] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • Q QSMZ

        Hi I want to use MS Excell in VC++ program for recording and plotting data. Should I use CRecordSet Class or else. If yes, can I have some example program for it? Regards

        R Offline
        R Offline
        Roger Stoltz
        wrote on last edited by
        #3

        QSMZ wrote:

        I want to use MS Excell in VC++ program for recording and plotting data.

        I'm not really clear on what you mean. Perhaps you would benefit from writing a DLL that you use from Excel for "data recording" depending on the where you get the "data" from. If you only want Excel for presentation reasons you may record and plot the data in your own application, but save it to an Excel file and draw charts in it using automation as Cédric said. I've done this about five years ago, but unfortunately that means I don't have any source code to give away and I've forgotten the details. However, it's not really that hard, just search for Excel and automation and you'll get a lot of useful results. One tip I remember though, use multidimensional safearrays for writing the data into the Excel sheet if you have a lot of data. I had about 10MB and writing it cell by cell took about 40 minutes. Using a multidimensional safearray it only took a couple of seconds.

        "It's supposed to be hard, otherwise anybody could do it!" - selfquote
        "High speed never compensates for wrong direction!" - unknown

        1 Reply Last reply
        0
        • Q QSMZ

          Hi I want to use MS Excell in VC++ program for recording and plotting data. Should I use CRecordSet Class or else. If yes, can I have some example program for it? Regards

          S Offline
          S Offline
          Sameerkumar Namdeo
          wrote on last edited by
          #4

          search BasicExcel on codeproject

          1 Reply Last reply
          0
          • Q QSMZ

            Hi I want to use MS Excell in VC++ program for recording and plotting data. Should I use CRecordSet Class or else. If yes, can I have some example program for it? Regards

            S Offline
            S Offline
            SnowHow
            wrote on last edited by
            #5

            A Simple search of code project yields a number of jewels. ^[] there are a lot of things to consider when you begin trying to use windows office automation not the least of which C++ isn't the "best choice". VB ultimately is a much better choice for this type of task(native language for excel). Also for deployment will the target users all have office? will they have the "right" version of office? Do you really need to write a full blown app or will VB scripting do the job? Excel objects are setup just like the in the program books, pages, range and cell.

            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