Click here to Skip to main content
16,018,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sounds very stupid but...

Tried to find something usefull but so far I found only something about OleDB...

I have a list of object. In each object I have 3 string fields.

I need to write all of them into excel document (create table in excel ofcourse).
Is there an simple way to do it? (Without database and connection string)?
Posted

You can't really write a raw excel file (xls, xlsx) without either OLE or Interoperable code and both require excel to actually be on the machine.

The files are a horrible binary format and if you want to really have a crack at raw writing them the specification is here

http://msdn.microsoft.com/en-us/library/cc313154%28v=office.14%29.aspx[^]

The alternative is to write a simple comma seperated value text file (CSV) which excel supports on it's import.

http://en.wikipedia.org/wiki/Comma-separated_values[^]

If you really need xlx,xlsx files then interoperable code is easy but it is excel version specific. OLE is a little more complicated to setup and use but it is generic to the different versions.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900