We are using TXLSReadWriteII5 component to extract data to xlsx universal format.
I got a problem with the "ShrinkToFit" procedure for a column property. This returns an exception and wont work. I use it successfully with a row.
Here is a mini-sample where I reproduced the error :
Code: Select all
Try
XLSReadWriteII51.Clear(1);
//Create the empty file
XLSReadWriteII51.Filename:=MyFileName;
XLSReadWriteII51.Write;
XLSReadWriteII51[0].Name:='EXPORT';
XLSReadWriteII51[0].AsString[0,0]:='TEST SHRINK_TO_FIT';
XLSReadWriteII51[0].Cell[0,0].Rotation:=90;
//This line works correctly
XLSReadWriteII51[0].Rows[0].ShrinkToFit:=True;
//This line returns the following exception :
{Le projet Project1.exe a provoqué une classe d'exception EAccessViolation
avec le message 'Violation d'accès à l'adresse 006A1890 dans le module
'Project1.exe'. Lecture de l'adresse 0000001C'.
Processus stoppé. Utilisez Pas-à-pas ou Exécuter pour continuer.
}
XLSReadWriteII51[0].Columns[0].ShrinkToFit:=True;
XLSReadWriteII51.Write;
Except
End;
Does anything else exist to make the columns width fit the content?
Thanks a lot.
Noémie