Page 1 of 2
ExcelWriter (creates MS-Excel '97 compatible files)
Posted: Fri Apr 07, 2006 7:09 pm
by ABBKlaus
Hi,
i made a conversion of the excelapi from Paul Squires. (see here
http://www.planetsquires.com)
http://www.purebasicpower.de/?ExcelWriter
Klaus
Posted: Fri Apr 07, 2006 7:32 pm
by Num3
Well i've seen that it doesn't require F64 lib anymore, but it just creates a blank document for me...
Posted: Fri Apr 07, 2006 7:53 pm
by ABBKlaus
the example with the XIncludeFile does not need the F64 lib its only for PB4 Beta !
but i can“t reproduce your problem with the blank file, the example i delivered just works fine here.
can you put a snippet together and post it here
you can also debug each command :
Code: Select all
XIncludeFile("Source\ExcelWriter_res.pb")
XIncludeFile("Source\ExcelWriter.pb")
XLS_Init() ; Wichtig !!! muss hier stehen ist ja keine PB lib
Debug XLS_CreateFile("C:\Data\Test.xls")
Debug GetLastError_()
Debug XLS_PrintGridLines(#False)
Debug GetLastError_()
Klaus
Posted: Fri Apr 07, 2006 8:03 pm
by Num3
Tried that and - No errors!
I just get a 900kb empty file...
I wonder if it has something to do with using OpenOffice...
I find the size too big, for such a small output...
Posted: Fri Apr 07, 2006 8:10 pm
by ts-soft
In opencalc i see nothing, but in excel is good

Posted: Wed Apr 26, 2006 9:38 pm
by Droopy
Very useful, thanks a lot

Posted: Thu Oct 26, 2006 9:35 pm
by Flype
hello,
i began a lib (pb4) for writing excel files in XML format.
Since MS Office use this format it becames much easier to implement.
you might be interested in this try - ( just a start - not a full featured lib )
PureXLS ->
UserLib_PB40_PureXLS.zip
here is how xml tags are organized :
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Workbook>
<Styles>
<Style>
<Alignment/>
<Borders>
<Border/>
</Borders>
<Font/>
<Interior/>
</Style>
</Styles>
<Worksheet>
<Table>
<Column/>
<Row>
<Cell>
<Data/>
</Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
Posted: Fri Oct 27, 2006 12:13 am
by zikitrake
Flype wrote:hello,
i began a lib (pb4) for writing excel files in XML format.
Since MS Office use this format it becames much easier to implement.
don't works in Office 2000

Posted: Fri Oct 27, 2006 6:30 am
by Flype
oh sorry, i forgot to say that MS Office understand XML Worksheets only since MS Office XP/2002/2003/+
Posted: Fri Nov 09, 2007 11:53 pm
by ABBKlaus
Posted: Sat Nov 10, 2007 11:08 am
by mskuma
Thanks alot for this. Looks very useful. However I quickly tried the supplied example to write out some unicode text, and open the resultant excel file and the text appeared as garbage chars instead of the Japanese text I typed (compiled with UTF-8 source & set compile to unicode & specified subsystem 'UserLibUnicode'). I also tried changing the font to a Japanese one, but same result. Has the unicode version been tested? Thanks again.
Posted: Tue Mar 04, 2008 5:16 am
by Rook Zimbabwe
I cannot get it to work in 4.2b2
I get the same error attempting to run the example code:
http://www.bluemesapc.com/image/excelwrite1.jpg
What am I not doing.
And how many of those User Libraries do I have to install?

Posted: Tue Mar 04, 2008 5:24 am
by Rook Zimbabwe
I remmed out:
; XLS_Init() ; Wichtig !!! muss hier stehen ist ja keine PB lib
Debug XLS_CreateFile("C:\Data\Test.xls")
Debug GetLastError_()
And debug showed
0
6
0
6
But it appears to have worked... the file exists. 4.1
not 4.2b2
And I have to put the two resource files in the same directory as the program.
Posted: Tue Mar 04, 2008 12:27 pm
by ABBKlaus
Sorry Rook, i had no time to compile a new userlib for Beta2.
You could use it as include file :
Code: Select all
XIncludeFile #PB_Compiler_Home+"Examples\Excel_Writer\Source\ExcelWriter.pb"
;include the resident file if needed
XIncludeFile #PB_Compiler_Home+"Examples\Excel_Writer\Source\ExcelWriter_res.pb"
;Init
XLS_Init()
Posted: Tue Mar 04, 2008 4:16 pm
by Rook Zimbabwe
I keep getting this error
Mind yuo, I am not using UNICODE or threadsafe...
It opens one of the
include files and stops on that line...