Thread: How to access excel sheet with C program(open,read,write)

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    2

    Exclamation How to access excel sheet with C program(open,read,write)

    Hi friends,
    I don't know how to open, read and write to excel sheet with C code

  2. #2
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Take a look at microsoft sites.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Probably the same way that this other poster was after MS .DOC files
    http://cboard.cprogramming.com/showthread.php?t=75085

  4. #4
    The Richness... Richie T's Avatar
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    469
    exactly as that thread said, there is a lot of additional formatting
    involved with document types other than .txt, but i found that
    you can write to an excel file just as you write to a text file, using
    fprintf. your ability to control excel from within a C program is
    fairly limited unless you learn how to program formatting info in
    as well (which would be quite complex), but if you had a program
    that needed to log outputs for some calculation, i found that you
    can write to a spreadsheet - \n will move your destination cell to
    the one below the current cell, \t will move it to the cell on the
    right. this may be somewhat useful to you, but as far as reading
    in from a spreadsheet in C, you're on your own
    No No's:
    fflush (stdin); gets (); void main ();


    Goodies:
    Example of fgets (); The FAQ, C/C++ Reference


    My Gear:
    OS - Windows XP
    IDE - MS Visual C++ 2008 Express Edition


    ASCII stupid question, get a stupid ANSI

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    I agree, given than excel can readily import tab or comma separated data from text files (I've done this many times), the amount of work it would take to generate a .xls file manually (without Microsoft's API) seems prohibitive.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Excel question
    By Dark_Phoenix in forum Tech Board
    Replies: 2
    Last Post: 12-10-2007, 09:10 PM
  2. Order of access labels in class definition
    By Mario F. in forum C++ Programming
    Replies: 10
    Last Post: 06-16-2006, 07:13 AM
  3. C++ Builder and Excel files
    By mfdemi in forum Windows Programming
    Replies: 3
    Last Post: 09-24-2004, 01:51 AM
  4. how do access and read data in from an excel file
    By hamilton73 in forum C++ Programming
    Replies: 2
    Last Post: 09-26-2001, 10:00 PM
  5. How to convert access file to excel file????
    By husna in forum Windows Programming
    Replies: 2
    Last Post: 09-03-2001, 09:59 PM