C++ and MS Excel

This is a discussion on C++ and MS Excel within the C++ Programming forums, part of the General Programming Boards category; Hi, I've written some programs in C++ before which open and write to plain text files. However, I was wondering ...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    5

    C++ and MS Excel

    Hi,

    I've written some programs in C++ before which open and write to plain text files. However, I was wondering if it is possible to do the same with MS Excel files. If it is, is there any way to control which cells within the Excel file are written to?

    I've tried searching the Internet for some possible solutions but the few which I have found are quite unclear. (By the way, I am using MS Office XP)

    Any help would be greatly appreciated. Thanks so much!

  2. #2
    Registered User Kurisu's Avatar
    Join Date
    Feb 2006
    Posts
    62
    Would The Comma Separated Value (CSV) File Format work for you? I'm sure Excel would accept that and give you some control of how data is displayed within Excel. Although I'm just guessing so maybe someone else can give you a better answer. Perhaps XML format or something

  3. #3
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    there are a couple of ways to do this.

    you can either access the excel object model from C++, or you could try writing the file yourself with the excel file format, although that can change from version to version.
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

Popular pages Recent additions subscribe to a feed

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