.NOY Framework


How to create Excel Workbooks In C#

Accessing and using office components from .net framework is not trivial (god knows why).
There is a complex office API and some weird security configurations that need to be done.
After wasting a lot of time trying to create a simple file with a simple table, I decided to share with you the articles that helped me.

Accessing office components from c# are well described in this great article By Doctor Peter A. Bromberg.

But!!!! this is not sufficient. after executing this code you will bump into weird security exceptions.
Solving those issues are well described in this article by Sushmita Kumari

Have fun

3 Responses to “How to create Excel Workbooks In C#”

  1. Reshef Says:

    I don’t exactly know what u tried to achieve but this might help:
    http://filehelpers.sourceforge.net/example_exceldatalink.html

  2. Autoversicherung Says:

    Hello, i have this comment find from Googlesearch. Greatfull Comment. Thanks and Best Regards from Germany

  3. Greg Smithies Says:

    I was once stuck with having to write an application that needed to output to Excel, and so had to fight my way through their API. After a few days, I came up with the following brain-wave - Excel understands XML files perfectly. I created a mock version of the spreadsheet output I needed in Excel and saved it as XML. I then opened that XML file in a text editor and took a look at it’s format (it’s pretty straight forward as long as you aren’t doing very complex things.) Then I just wrote my programs to dump raw xml data to a text file in the same format that Excel creates it and told Excel from my program to open the file through VBA. Basically I was able to get all of the functionality I needed in terms of interaction between excel and my app, all without ever using the official excel API. Just a thought

Leave a Reply

Jajah is the VoIP player that brought you web-activated telephony.