If I set the pixelSize of a row or column the width or height of the column/row is very inaccurate.
It seems also to be very inconsistent.
Small example:
XLS := TXLSReadWriteII5.Create(nil);
XLS.Filename := 'D:\test.xlsx';
....
XLS[0].Columns[0].PixelWidth := 64 <-results in '56'.
...
for i = 0 to 100 do begin
XLS[0].Columns[0].PixelWidth := XLS[0].Columns[0].PixelWidth <- This should not change the width but afterwards the width is '0' or even negative!
end ...
the same happens to the row height.
The problem is that reading/writing the PixelWidth property is not compatible. Unfortunately, it's not possible to change the behavior as other parts is dependent on it. Instead, there is a new property, PixelWidth2 that reads/writes compatible values.
Thank you, but the values seem not to be correct.
If I set the pixelwidth2 of a column to e.g.500 pixels and open the file afterwards, excel tells me that the width of the column is 497 pixels.
This is only a minor issue if i format just one column but i need to format lots of columns and the difference between the desired width and the actual width will be greater.
The width of the columns also affects images even if I set the positioning of the images to limage.Positioning := doipdonotmoveorsize;
Sorry, this is the best for the moment. The problem is that the cell width is based on character widths and converting this to pixels is difficult as the documentation is not good on this. My suggestion is to not use pixels when setting the width.