How do i edit excel files?

I want to make a c++ program that edits a excel file with what has been inputted into it. But the problem is that i only know how to do it with a csv file which is useless to me as i want to also want to change the colour of cells.

So is there a file format that can allow me to change the colour of cells and do borders around cells as well?
You can use http://libxl.com/ or something similar for easy editing. Not sure how well it works, never been interested in doing that myself.
If you intend to use your program on a computer that has Excel installed, you can use the Excel programmatic COM interface.
If you're looking for information on controlling Excel, the phrase to search for is "Excel Automation", though you will prob. need to quality your searches with C++ to avoid all the C# and VB.NET discussions.

There are a number of threads on this subject on this forum already, as well as about the greater web. For example, this recent one:

Need to select a cell or range in excel, from C++ code
http://www.cplusplus.com/forum/windows/164379/

(Here you'll see that I prefer to use Direct-to-COM style programming (using compiler generated smart wrapper classes) whereas freddie1 prefers to work the WinAPI COM Automation functions directly.)

Andy

PS When you say:

So is there a file format that can allow me to change the colour of cells and do borders around cells as well?

You are meaning one which you can load back into Excel, yes?
Last edited on
Topic archived. No new replies allowed.