Exporting to spreadsheet (excel or other)

This is a discussion on Exporting to spreadsheet (excel or other) within the C Programming forums, part of the General Programming Boards category; I have already made a program that exports some information to Access database using ODBC and SQL, and I was ...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    2

    Exporting to spreadsheet (excel or other)

    I have already made a program that exports some information to Access database using ODBC and SQL, and I was wondering if there is a similar thing for spreadsheets and if so where I can get information on it

    Thanks!

  2. #2
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    If your using C as far as I know there isn't anyting to interface with Excel. If you want to do that you'll have to learn COM and take it from there. Or you might try manipulating a CSV file. search the board Or pm me for more info.

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You can use ODBC/SQL with Excel, very similar to the way you use it with Access. You just have to alter your connection string and SQL statements. Here is a C sample that demonstrates reading and writing to Excel using the windows ODBC API. You can use whatever ODBC API you are comfortable with.

    Treating Excel as a database does not let you set formatting, etc. To do that you can have a look at this sample that demonstrates the binary manipulation of an Excel file or you can use the COM interfaces that Excel provides.

    To use the COM interfaces you can use MFC or have a look at other COM helper libraries such as DispHelper, especially the Excel sample(also available in C++).

    As mentioned, if you just want to export spreadsheet values, you should look into using a comma seperated values(csv) file. These are compatible with most spreadsheet software.
    Last edited by anonytmouse; 07-29-2004 at 12:28 AM.

  4. #4
    Registered User
    Join Date
    Jul 2004
    Posts
    2

    csv file

    I think that's going to be enough for me in this situation. I was kindof leary about the whole ODBC thing anyways (took me forever to get it perfect last time)

    Thanks a lot! (I haven't actually got it running yet, but I'm confident...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dissecting an Excel XML spreadsheet
    By desmond5 in forum C++ Programming
    Replies: 1
    Last Post: 05-22-2008, 05:32 PM
  2. Replies: 2
    Last Post: 11-30-2006, 08:04 AM
  3. Replies: 1
    Last Post: 05-06-2006, 12:17 AM
  4. Exporting a DataTable to Excel (.NET)
    By Trauts in forum C# Programming
    Replies: 0
    Last Post: 07-29-2005, 02:03 PM
  5. Is it possible to write into an Excel spreadsheet?
    By rtsc17 in forum C++ Programming
    Replies: 6
    Last Post: 09-18-2003, 11:15 AM

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