Page 1 of 1

HorizAlignment and VertAlignment don't work in 2007

Posted: Sun May 02, 2010 10:16 am
by antonb
Hi,

I have tried the following code and when I export to Excel 2007 format the alignments are completely ignored. If I export to Excel 97 - 2003 format it applies the formatting:

procedure TForm1.Button15Click(Sender: TObject);
var
Temp : TXLSReadWriteII4;
begin
Temp := TXLSReadWriteII4.Create(Self);
try
temp.Filename := 'C:\fileXLSReadWrite.xlsx';
Temp.Version := xvExcel2007;

Temp.Sheet[0].AsString[1,6] := 'Anton';
Temp.Sheet[0].Cell[1,6].HorizAlignment := chaCenter;
Temp.Sheet[0].Cell[1,6].VertAlignment := cvaCenter;
Temp.Write;
finally
Temp.Free;
end;
end;

Now I remember reading somewhere that the Excel 2007 functionality currently supports cell formatting and wrapping. Why is this functionality not working?
How can I get this to work?

Anton Bosch

Re: HorizAlignment and VertAlignment don't work in 2007

Posted: Sun May 02, 2010 10:29 am
by antonb
Sorry forgot to mention I am using 4.00.31

Re: HorizAlignment and VertAlignment don't work in 2007

Posted: Thu May 06, 2010 7:04 am
by larsa
Hello

This will be fixed in a later update.