Michael
Michael

Reputation: 13616

How to work with .xls file in C# application

In a C# console application I have a PointF[] array. I need to draw those points in an .xls chart file, but I need guidance how to do this?

Upvotes: 0

Views: 309

Answers (1)

Cyrus
Cyrus

Reputation: 344

Have a look at Open XML SDK 2.0 for Microsoft Office

I've used it before to do something like you're describing.

I started off creating an .xls file in Excel that had the correct chart which read values from a specific range of cells and so on. Then using the SDK I added/changed the values of those cells and saved a new version of the file. So basically I used the file created in Excel as a template that I could change whenever without changing the code (as long as the values are written to the same range of cells).

You could also put the value cells in a separate worksheet so that the user does not see them when opening the file...

Upvotes: 1

Related Questions