1. Creating an Excel file?

Does anyone have code to create simple Excel files in Euphoria? I know you can write a CSV file and Excel will open the file, but I am hoping to provide a bit for formatting. I am not against using DDE type code if necessary, but was hoping to be able to use do something like:

integer fh = open("file.xls", "wb") 
 
addCell(fh, 1, 1, "Name", {"font=bold", "size=15"}) 
addCell(fh, 2, 1, "John", {}) 
addCell(fh, 2, 1, "Jane", {}) 
-- etc... 

or something like that. May be asking too much.

Jeremy

new topic     » topic index » view message » categorize

2. Re: Creating an Excel file?

Jeremy Cowgar said...

Does anyone have code to create simple Excel files in Euphoria? I know you can write a CSV file and Excel will open the file, but I am hoping to provide a bit for formatting. I am not against using DDE type code if necessary, but was hoping to be able to use do something like:

[snip]

or something like that. May be asking too much.

Jeremy

There is something in the Archive to do this. However, the Archive is not currently search able. getlost

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Creating an Excel file?

Jeremy Cowgar said...

Does anyone have code to create simple Excel files in Euphoria? I know you can write a CSV file and Excel will open the file, but I am hoping to provide a bit for formatting. I am not against using DDE type code if necessary, but was hoping to be able to use do something like:

integer fh = open("file.xls", "wb") 
 
addCell(fh, 1, 1, "Name", {"font=bold", "size=15"}) 
addCell(fh, 2, 1, "John", {}) 
addCell(fh, 2, 1, "Jane", {}) 
-- etc... 

or something like that. May be asking too much.

There is an Excel demo for eucom:

http://sourceforge.net/projects/eucom/

Matt

new topic     » goto parent     » topic index » view message » categorize

4. Re: Creating an Excel file?

Greg Haberek said...

There is something in the Archive to do this. However, the Archive is not currently search able. getlost

I thought I remembered searching for one before w/no luck, that's why I asked here. However, since you said there was, I browsed each category. I found it under Utilities. Thanks for the pointer. It's doing what I want, as of now. It only has add_label and add_number routines, but I can work with it.

Thanks for the tip!

Jeremy

new topic     » goto parent     » topic index » view message » categorize

5. Re: Creating an Excel file?

Matt Lewis said...

There is an Excel demo for eucom:

http://sourceforge.net/projects/eucom/

Thanks for the pointer, but since I found straight Euphoria code that will do it, I am going to use that. It will mean we can generate Excel files from a web server too, which I would like to be able to do.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

6. Re: Creating an Excel file?

Jeremy Cowgar said...

Does anyone have code to create simple Excel files in Euphoria? I know you can write a CSV file and Excel will open the file, but I am hoping to provide a bit for formatting. I am not against using DDE type code if necessary, but was hoping to be able to use do something like:

integer fh = open("file.xls", "wb") 
 
addCell(fh, 1, 1, "Name", {"font=bold", "size=15"}) 
addCell(fh, 2, 1, "John", {}) 
addCell(fh, 2, 1, "Jane", {}) 
-- etc... 

or something like that. May be asking too much.

Jeremy

Your best bet is to create an HTML table and save it with an XLS extension. MS Excel will be quite happy to read it completely formatted as if it were a BIFF8/OLE2 (Excel's native format) file. OpenOffice, however, will try to open the file with Writer instead of Calc. The demo in the archives uses BIFF2, which is a very old format that modern versions of Excel have trouble with. OpenOffice, however, reads it just fine.

Contrary to common sense, Microsoft Office files are really FAT file systems, with indexed tables and pointers all over the place. I have a very limited program to read BIFF8 files, but haven't been successful with writing them, and haven't tried too hard since the HTML option is so much easier.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Creating an Excel file?

Greg Haberek said...
Jeremy Cowgar said...

Does anyone have code to create simple Excel files in Euphoria? I know you can write a CSV file and Excel will open the file, but I am hoping to provide a bit for formatting. I am not against using DDE type code if necessary, but was hoping to be able to use do something like:

[snip]

or something like that. May be asking too much.

Jeremy

There is something in the Archive to do this. However, the Archive is not currently search able. getlost

-Greg

EuCom comes with examples on interfacing with Excel. There is also a small file probably named excelwrite.zip (which I unearthed as Dd766.zip in my recycle bin). Emailing it now.

CChris

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu