anytype getExcelCellValue(int _row,
int _col)
{
COMVariantType comVariantType;
SysExcelCells cells;
anyType retVal;
;
comVariantType = cells.item(_row, _col).value().variantType();
switch (comVariantType)
{
case COMVariantType::VT_BSTR :
retVal = cells.item(_row, _col).value().bStr();
break;
case COMVariantType::VT_R8 :
retVal = cells.item(_row, _col).value().double();
break;
case COMVariantType::VT_INT :
retVal = cells.item(_row, _col).value().int();
break;
case COMVariantType::VT_DATE :
retVal = cells.item(_row, _col).value().date();
break;
case COMVariantType::VT_EMPTY :
retVal = cells.item(_row, _col).value().bStr();
break;
default :
retVal = "";
break;
}
return retVal;
}
int _col)
{
COMVariantType comVariantType;
SysExcelCells cells;
anyType retVal;
;
comVariantType = cells.item(_row, _col).value().variantType();
switch (comVariantType)
{
case COMVariantType::VT_BSTR :
retVal = cells.item(_row, _col).value().bStr();
break;
case COMVariantType::VT_R8 :
retVal = cells.item(_row, _col).value().double();
break;
case COMVariantType::VT_INT :
retVal = cells.item(_row, _col).value().int();
break;
case COMVariantType::VT_DATE :
retVal = cells.item(_row, _col).value().date();
break;
case COMVariantType::VT_EMPTY :
retVal = cells.item(_row, _col).value().bStr();
break;
default :
retVal = "";
break;
}
return retVal;
}
No comments:
Post a Comment