Thread: C on Excel

  1. #1
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751

    C on Excel

    hi everyone,

    i'm new to the board and to C programming. I was just wondering if it is possible to create a program in c that would allow me to manipulate an excel file?

    If so how do i go about doing that? what do i need to know. Thank you very much in advance

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    You need to know COM programming to work with an excell document.
    Another possibility is to save the excell data as a CSV file. Which can be manipulated via normal file I/O.

    gg

  3. #3
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    Hey code plug, can you give me some links to learning COM. i visited MSDN and i couldn't get too much info, i googled it as well, and most of the info was for use with C++. Will i have to use visual c, or c++ to do COM programming?

    Also how can i do so with the csv way. You weren't too specific.

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    You will definately want to use VC++ for COM programming instead of C.
    VC++ makes it really easy via the #import directive (I don't know if other compilers have something similiar). But, that's getting into COM programming details that you need to learn from a book. You can try to find some online tutrials but they probably won't be enough.
    Also, you want to have a solid foundation in C and C++ programming before tackling COM using those languages. Just to wet your whistle, here is simple example using COM that creates an excell workbook, worksheet, populates the worksheet, then saves it. (I found the site with a Google search).

    As for CSV files, this is just a simple text format that you can save your workbooks as (using File->Save As in Excel). Since CSV files are in a text format, you can write code that reads and writes the file directly. Here's a good description of the CSV format from www.wotsit.org.

    gg

  5. #5
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    Thank you so much. You realy help me a lot. that post on experts exchange was exactly what i was looking for. Thank you again.

    personal note: This is why i really hate mircosoft. They've encapsulated all there code to the point of idiocy. I understand they are meant to be user friendly, but man i wish i could get at the codee!!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Organization and Excel
    By uniqst3r in forum C Programming
    Replies: 4
    Last Post: 05-26-2008, 01:37 AM
  2. using Excel to connect to external data source
    By George2 in forum Windows Programming
    Replies: 4
    Last Post: 05-01-2007, 10:07 PM
  3. Exporting a DataTable to Excel (.NET)
    By Trauts in forum C# Programming
    Replies: 0
    Last Post: 07-29-2005, 01:03 PM
  4. C++ Builder and Excel files
    By mfdemi in forum Windows Programming
    Replies: 3
    Last Post: 09-24-2004, 01:51 AM
  5. Print a File via Excel
    By ginoitalo in forum C# Programming
    Replies: 2
    Last Post: 05-10-2002, 12:33 AM