Answer the question
In order to leave comments, you need to log in
How to understand that the cell is empty (xlsreadwriteii 5)?
RAD Studio 10.1 Berlin.
I work with excel - xlsx. xlsreadwriteii component 5.
All data is being read, but there was a problem. xlsreadwriteii 5 cannot detect an empty cell.
When setting a condition. For example - if the cell contains text 1, do one thing, and if it is empty, do another.
Excel - Cell Format General. The numbers are saved as text.
So he (xlsreadwriteii 5) finds text 1, but there are no empty cells.
XLS:=TXLSReadWriteII5.Create(nil);
XLS.Filename:=ExtractFilePath(Application.ExeName)+'file.xlsx';
XLS.Read;
XLS[0].CalcDimensions;
//Еще код.....
//Читаем содержимое ячейки в переменную
NUMBER:=XLS[0].AsString[NUMBER_column,row];
//Узнаем длину строки
Form1.Memo1.lines.add('Длина строки NUMBER='+inttostr(Length(NUMBER)));
if (NUMBER='') then Form1.Memo1.lines.add('Пусто');
if (NUMBER='1') then Form1.Memo1.lines.add('Единица');
Answer the question
In order to leave comments, you need to log in
So look at what you have in NUMBER after you have read an empty cell. There will most likely be some kind of LF or maybe TAB.
View in the source files TXLSReadWriteII5
how the cell is read.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question