Thread: Generate Excel-file using C/C++. How?

  1. #1

    Generate Excel-file using C/C++. How?

    I've got a C-file, and I'd like to generate an Excel worksheet with some content and some graphs.

    Got any ideas on how I proceed? Do I translate to C++?

    Thanks :-)


  2. #2
    Registered User (TNT)'s Avatar
    Join Date
    Aug 2001

    You can use a .csv file, their format is pretty easy and you can just write it out from your proggy, however you can only use data in these, not graphs as you mentioned, you should play around with excel and save some sheets as .csv and look at the format you will see that not everything is supported like formulas which may be a problem, but it will be alot harder if you wanna start making graphs from your program.

    Hope that helps,
    You Can Stop Me, But You Cant Stop Us All

  3. #3
    Registered User
    Join Date
    Sep 2001
    If you used C++ and MFC you could use your app as an automation client for excel and automate excel to enter data and make graphs. It's relatively easy to do with MFC, and there are some good tutorials in the MS knowledge base, as excel is also a very powerful automation server anything you can do from excel itself can be done by automating it.
    The disadvantages are you would need to have excel installed on any PC you ran the app on, and automation creates quite a lot of overhead.
    It is possible to use automation without MFC but its much harder, as you would need to understand COM and be able to obtain and use excel interfaces from it.

  4. #4
    Thanks, guys!

    I think I'll switch to Visual Basic, though!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  2. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  3. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  4. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  5. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM