how do access and read data in from an excel file

This is a discussion on how do access and read data in from an excel file within the C++ Programming forums, part of the General Programming Boards category; I am writing a program that needs to read in an excel file and I would rather not resave the ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    2

    how do access and read data in from an excel file

    I am writing a program that needs to read in an excel file and I would rather not resave the file as a text file. So the question is can I just open a file stream for the excel file and read the data like I would in a text file.

  2. #2
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    It might be easier if you saved the document in csv form.
    Then it would be very easy to pull the info.

    Unless you know the format of an excel file I don't think it will be very easy to do it that way.

    A normal excel file would be undecipherable I think.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    156
    If you're using Excel I'm guessing your using VC++. The good news yes you can, the bad news is the plumbing is not trivial. I recommend using MFC and its CDatabase and CRecordset classes or and more likely a better approach would be using ATL OLE DB.

    You can look these up on MSDN there are lots of ODBC and OLE DB samples. As a starting point I'd look for "Creating an OLE DB Consumer" and "Creating an OLE DB Template Provider".

    There are also some good books on it such as "OLE DB and ODBC Developer's Guide". It covers both.

    I hope that helps.

    dang

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. How to Parallel reading flat file into C ?
    By anwar_pat in forum C Programming
    Replies: 11
    Last Post: 09-16-2006, 09:44 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Replies: 1
    Last Post: 12-01-2002, 12:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21