Monday, August 28, 2017

Get Excel cell value in common

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;
}

No comments:

Post a Comment

Disabling the flight in D365FO (CHD - Tier 1)

 INSERT INTO dbo.SYSFLIGHTING(FLIGHTNAME, ENABLED)  VALUES ('<FlightObjectName>_KillSwitch', 1)  or  INSERT INTO dbo.SYSFLIGHT...