Hi.
I got an error box '' some text formatting may have changed in this file because the maximum number of font was exceeded'' when setting the BorderBottomStyle
for a xls (Excel97) file. And also ExcelFile.Items[0].Name does not seem to work properly
Sample code:
var
ExcelFile : TXLSReadWriteII5;
begin
ExcelFile := TXLSReadWriteII5.Create(nil);
ExcelFile.Version := xvExcel97;
ExcelFile.Filename := 'C:\output.xls';
ExcelFile.Items[0].Name := 'test'; <- does not change the sheetname
ExcelFile[0].InsertStringRowValues(0,0,['hallo', 'test']);
ExcelFile.items[0].Cell[1,0].BorderBottomStyle := cbsthick; <- error if I try to open the file in excel
ExcelFile.Write;
end;
Any help would be appreciated.
Thanks in advance
d3nton
XLSReadWriteII 5 - Maximum number of fonts exceeded
Re: XLSReadWriteII 5 - Maximum number of fonts exceeded
Hello
Before you can format a cell, there must first be a cell at the position. Add at least a blank cell. Or use the Range property. It will add the cells (blank) for you.
I shall check the sheet name issue.
Before you can format a cell, there must first be a cell at the position. Add at least a blank cell. Or use the Range property. It will add the cells (blank) for you.
I shall check the sheet name issue.
Lars Arvidsson, Axolot Data
Re: XLSReadWriteII 5 - Maximum number of fonts exceeded
Hello larsa.
Thanks for the quick reply.
>Before you can format a cell, there must first be a cell at the position.
But there is already a cell. I use ExcelFile[0].InsertStringRowValues(0,0,['hallo', 'test'])
in order to add two cells to the sheet (one with 'hallo' (A1) and a second one with 'test' (B1)).
ExcelFile.items[0].Cell[1,0].BorderBottomStyle := cbsthick adds a thick line to the B1 'test' cell.
The code above works for xvExcel2007 (xlsx).
I only changed xvExcel2007 to xvExcel97 and output.xlsx to output.xls and got the 'font exceeded' error.
Even if i am using some code snippets from your 'FormatCells' example
( ExcelFile[0].Range[4,2,6,8].FillPatternForeColor := $5050FF;
ExcelFile[0].Range[4,2,6,8].BorderOutlineStyle := cbsMedium;
ExcelFile[0].Range[4,2,6,8].BorderOutlineColor := $A1601F;)
it seems only to work for xvExcel2007 and not for xvExcel97.
I am sorry but I can't get the code to work. Could you please test this or give me some example code
for the use of BorderBottomStyle in xvExcel97.
Thank you !
Thanks for the quick reply.
>Before you can format a cell, there must first be a cell at the position.
But there is already a cell. I use ExcelFile[0].InsertStringRowValues(0,0,['hallo', 'test'])
in order to add two cells to the sheet (one with 'hallo' (A1) and a second one with 'test' (B1)).
ExcelFile.items[0].Cell[1,0].BorderBottomStyle := cbsthick adds a thick line to the B1 'test' cell.
The code above works for xvExcel2007 (xlsx).
I only changed xvExcel2007 to xvExcel97 and output.xlsx to output.xls and got the 'font exceeded' error.
Even if i am using some code snippets from your 'FormatCells' example
( ExcelFile[0].Range[4,2,6,8].FillPatternForeColor := $5050FF;
ExcelFile[0].Range[4,2,6,8].BorderOutlineStyle := cbsMedium;
ExcelFile[0].Range[4,2,6,8].BorderOutlineColor := $A1601F;)
it seems only to work for xvExcel2007 and not for xvExcel97.
I am sorry but I can't get the code to work. Could you please test this or give me some example code
for the use of BorderBottomStyle in xvExcel97.
Thank you !
Re: XLSReadWriteII 5 - Maximum number of fonts exceeded
Hi.
I still don't get this working. Do you have any suggestions on how to change the above code so that it can
be executed without errors (for xls files)?
Is the code wrong or is it a bug in XLSReadWriteII 5?
Thanks in advance.
I still don't get this working. Do you have any suggestions on how to change the above code so that it can
be executed without errors (for xls files)?
Is the code wrong or is it a bug in XLSReadWriteII 5?
Thanks in advance.