Try to validate the cell that you read...
Str GetCellValue(sysExcelCell RCell)
{
Str CellValue;
Int IntegerValue;
;
switch(RCell.value().variantType()) {
case COMVariantType::VT_R4 :
IntegerValue= any2int(RCell.value().float());
CellValue = strfmt("%1",IntegerValue);
break;
case COMVariantType::VT_R8 :
IntegerValue = any2int(RCell.value().double());
CellValue= strfmt("%1",IntegerValue);
break;
case COMVariantType::VT_DECIMAL :
IntegerValue = any2int(RCell.value().double());
CellValue= strfmt("%1",IntegerValue);
break;
case COMVariantType::VT_BSTR :
CellValue= strfmt("%1",RCell.value().bStr());
break;
case COMVariantType::VT_I1:
CellValue = strfmt("%1",RCell.value().char());
break;
case COMVariantType::VT_I2:
CellValue = strfmt("%1",RCell.value().short());
break;
case COMVariantType::VT_I4:
CellValue= strfmt("%1",RCell.value().int());
if (CellValue== '0')
{
CellValue= strfmt("%1",RCell.value().long());
}
break;
case COMVariantType::VT_UI1:
CellValue= strfmt("%1",RCell.value().byte());
break;
case COMVariantType::VT_UI2:
CellValue= strfmt("%1",RCell.value().uShort());
break;
case COMVariantType::VT_UI4:
CellValue= strfmt("%1",RCell.value().uInt());
if (CellValue== '0')
{
CellValue= strfmt("%1",RCell.value().uLong());
}
break;
default:
throw error(strfmt("@SYS26908", RCell.value().variantType()));
}
return cellValue;
}
On Feb 1, 2008 9:32 AM, turkkanarda <[EMAIL PROTECTED]> wrote:
> Hi all;
>
> I have a problem about reading from excel cell.Cell format is text and
> "1111111111" is stored in the cell.I have the code below for reading
> the value but result is empty string.
>
> RCell = Cells.Item(i, 1);
> string = RCell.value().bStr();
>
> I can read double or int values succesfully but can not read text
> formatted numbers.
>
> if i change the cell value into "a" , this time i can read it from the
> cell.
>
> Regards;
>
>
>
--
Lic. Luis Enrique Martínez Peña
Analista Programador Axapta
Consultor Sistemas Web
Off. (81) 8335 0620 ext 8564
http://www.it-soluciones.com.mx
[Non-text portions of this message have been removed]