GetStringForCell is for mostly for display purposes, for most work, GetCellValue is what you want.
GetCellValue will return a TCellValue, which you can convert to a variant, or to a string, or to whatever is needed. And the conversion is automatic most of the time. For example, to assign the value to a database, if you have persistent fields, you would use:
ClientDataSet1LastName.Value := xls.GetCellValue(1, 1);
Dynamically, you would do something like:
ClientDataSet1.FieldByName('LastName').Value := xls.GetCellValue(1, 1);
Note that in the first case, a predefined field would be for example of type integer, while in the second it is a variant. In both cases, you can assign directly a TCellValue (what xls.GetCellVlue returns), and it will be assigned correctly. But there won't be any conversion from and to a string, you read a double from the xls file, you write a double to the database. There is no read double->convert to string->convert to double->assign to the database.
If you need more control assigning the result, just do something like this:
case CellValue.ValueType of
TCellValueType.Empty: ;
TCellValueType.Number: ;
TCellValueType.DateTime: ;
TCellValueType.StringValue: ;
TCellValueType.Boolean: ;
TCellValueType.Error: ;
TCellValueType.Formula: ;
end;
And do what's needed depending on the data type of the cell.
In a last case, if you really want to convert to string, still don't use GetCellFromString. As said, GetCellFromString is designed mostly for display purposes, so it will format the cell exactly as Excel will show it (including stuff like decimal separators). You can use CellValue.ToString to get a "simple string" without the formatting, but as said, you most likely don't want to convert to a string at all.
Note: The thing that can give you some headaches using GetCellValue is dates, and probably this is why you went with GetCellFromString in the first place. The thing with dates is that Excel treats the dates as numbers, so you will get a number in TCellValue (not a TDateTime). If you are assigning to a database and the database field is a TDateTime this should't be an issue, the TCellValue will be converted to a number. But in the most general case, you need to explicitly check for a Format that includes dates. Look at the "Reading files" demo to see how to handle dates.
Regards,
Adrian.