Hi,
How can I insert a line break in a cell in a way that it is displayed correctly?
I tried: AsString[0,0] := 'line1' + sLinebreak + 'line2';
When I open the excel file, the content of the first cell is "line1line2".
But when I simply click into the cell and press F2 and Enter, then the text is displayed correctly with the line break.
So, it somehow works to a certain extent.
I want Excel to show the line break right after opening the file without any unnecessary clicking.
How can this be done?
Thanks
Schmulm
Line Breaks in cells
Re: Line Breaks in cells
Hello
You must set WrapText := True
Example:
You must set WrapText := True
Example:
Code: Select all
XLS[0].AsString[1,1] := 'One' + #10 + 'Two';
XLS[0].Cell[1,1].WrapText := True;
Lars Arvidsson, Axolot Data