469,575 Members | 1,479 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

Creating simple Excel file

Hi,

Is there any open source / demo code that shows how to create a simple Excel
97 or later file without resorting to Interop?

My application currently creates a simple CSV file, but I would like it to
be able to create an XLS file with a single workbook, and add simple
attributes to the cells (color, font, value).

Searched GotDotNet and Source Forge, but didn't find anything yet.

Thanks,

Eric

Nov 16 '05 #1
2 5316
Hi Eric

One way of getting simple formatting into Excel without interop is to create
a html file with table tags. Excel will happily read an html file
preserving foreground /background colours, alignment etc.

eg. a file like this

---------------------------------
<TABLE>
<TR>
<TH ALIGN><FONT FACE = "Arial" SIZE=6>Col Head 1</FONT></TH>
<TH><FONT FACE = "Arial" SIZE=6>Col Head 1</FONT></TH>
</TR>
<TR>
<TD ALIGN="LEFT" BGCOLOR=blue ><FONT FACE = "Arial" COLOR=White>Text
Value</FONT></TD>
<TD ALIGN="RIGHT" BGCOLOR=white><FONT FACE = "Times New Roman"
COLOR=red>12</TD>
</TR>
</TABLE>
---------------------

Looks like this when loaded into excel

Col Head 1 Col Head 1
Text Value 12


Geoff

"Eric Johannsen" <no*********@johannsen.us> wrote in message
news:QB***************@newssvr25.news.prodigy.com. ..
Hi,

Is there any open source / demo code that shows how to create a simple Excel 97 or later file without resorting to Interop?

My application currently creates a simple CSV file, but I would like it to
be able to create an XLS file with a single workbook, and add simple
attributes to the cells (color, font, value).

Searched GotDotNet and Source Forge, but didn't find anything yet.

Thanks,

Eric

Nov 16 '05 #2
Thanks, works like a charm!

Eric

"news.blueyonder.co.uk" <j@s.com> wrote in message
news:X5**************@fe1.news.blueyonder.co.uk...
Hi Eric

One way of getting simple formatting into Excel without interop is to create a html file with table tags. Excel will happily read an html file
preserving foreground /background colours, alignment etc.

eg. a file like this

---------------------------------
<TABLE>
<TR>
<TH ALIGN><FONT FACE = "Arial" SIZE=6>Col Head 1</FONT></TH>
<TH><FONT FACE = "Arial" SIZE=6>Col Head 1</FONT></TH>
</TR>
<TR>
<TD ALIGN="LEFT" BGCOLOR=blue ><FONT FACE = "Arial" COLOR=White>Text Value</FONT></TD>
<TD ALIGN="RIGHT" BGCOLOR=white><FONT FACE = "Times New Roman"
COLOR=red>12</TD>
</TR>
</TABLE>
---------------------

Looks like this when loaded into excel

Col Head 1 Col Head 1
Text Value 12


Geoff

"Eric Johannsen" <no*********@johannsen.us> wrote in message
news:QB***************@newssvr25.news.prodigy.com. ..
Hi,

Is there any open source / demo code that shows how to create a simple

Excel
97 or later file without resorting to Interop?

My application currently creates a simple CSV file, but I would like it to be able to create an XLS file with a single workbook, and add simple
attributes to the cells (color, font, value).

Searched GotDotNet and Source Forge, but didn't find anything yet.

Thanks,

Eric



Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Jeremy Langworthy | last post: by
5 posts views Thread by Guy Incognito | last post: by
4 posts views Thread by Randy | last post: by
3 posts views Thread by A.M | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.