HorizAlignment and VertAlignment don't work in 2007

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
antonb
Posts: 4
Joined: Tue Mar 02, 2010 11:25 am

HorizAlignment and VertAlignment don't work in 2007

Post 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
antonb
Posts: 4
Joined: Tue Mar 02, 2010 11:25 am

Re: HorizAlignment and VertAlignment don't work in 2007

Post by antonb »

Sorry forgot to mention I am using 4.00.31
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: HorizAlignment and VertAlignment don't work in 2007

Post by larsa »

Hello

This will be fixed in a later update.
Lars Arvidsson, Axolot Data
Post Reply