Click here to Skip to main content
14,301,484 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi!

I've been searching for an example of how to create a xls file in C#. I have to use xls files for downstream compatibility.

What I have is daily reports pulled. I would like to combine them weekly/monthly into a single report(s).
all the files have the same headers and same type of data.

Is there a way to easily combine them? I can work out the when and whiles.

If someone is able to get me started that would be awesome.

I tried excellibrary but that doesn't seem to work with Excel 10.

Thanks!

Nick
Posted
Comments
Maciej Los 29-Apr-14 18:32pm
   
"I tried excellibrary but that doesn't seem to work with Excel 10." - is not informative at all!
Please, be more specific and provide more details about your issue. What have you done till now? Show your code!
Philippe Mori 29-Apr-14 19:51pm
   
If the people are using Office 2000, XP or 2003, they can install the compatibility pack and open XLSX files.
adriancs 29-Apr-14 21:04pm
   
This is one of the hottest question, most Frequently Asked Question. Perhaps someone should write an article "A Collection of Ways Existed in the World on How to Read/Write Excel in C#"

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

I'm not sure you really need to create XLS and all its compatibility; this thing is too outdated. XLSX is easier to work with, because you could use Open XML SDK. Please see my past answer:
Microsot office Interop[^].

By they way, please read Microsoft discouraging articles on using Office Interop:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^],
http://support.microsoft.com/kb/257757/en-us[^].

Anyway, there are some alternatives. Please see my past answer and other answers referenced: How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010[^].

See also this one, on Open XML: Creating basic Excel workbook with Open XML[^].

—SA
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100