TXLSColumn.GetPixelWidth Error using 3.01.05

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
torerik
Posts: 5
Joined: Fri Nov 12, 2004 2:08 am
Location: Norway

TXLSColumn.GetPixelWidth Error using 3.01.05

Post by torerik »

Please consider this test code with XLSReadWriteII2 version 3.01.05:
FXLS := TXLSReadWriteII2.Create(Self);
FXLS.FileName := 'test.xls';
FXLS.Read;
Memo1.Lines.Add(IntToStr(FXLS.Sheets[0].Columns[0].PixelWidth));

I generates an AccessViolation on this line in Columns2.pas:

Line 242: FFormats.Fonts[0].CopyToTFont(F);

Am I doing something wrong or is it a bug?

Tor Erik
torerik
Posts: 5
Joined: Fri Nov 12, 2004 2:08 am
Location: Norway

Sheet.Columns

Post by torerik »

I think the error is in the reading of my XLS fil itself because the AV was caused by the Column being nil.

Using MS Excel 2002, I create a new XLS file,
just adding the text a, b and c to columns A, B and C respectively.

When reading the file, the Sheet.Columns[] array are all nil although, the LastCol property correctly returns 2.

Then I resize the column A, increasing it to the double of its size, then the Sheet.Columns[0] is defined. Strange! Where are my columns?

Tor Erik
Post Reply