赋值到excel表,从excel表取值

来源:互联网 发布:php高并发解决方案视频 编辑:程序博客网 时间:2024/05/17 08:29

//赋值

range=sheet.get_Range(COleVariant(str2),COleVariant(str2));
                switch(ColumNum){//把值写到excel表中
             case 1:
                    str.Format(_T("%hu"),step.nSeqID);
              break;
             case 2:
                    str.Format(_T("%c"),step.ucType);
                    break;

range.put_Value2(COleVariant(str));

 

//取值

 COleVariant rValue;//获取excel单元格的值
 range=sheet.get_Range(COleVariant(str2),COleVariant(str2));
 rValue = COleVariant(range.get_Value2());
 step.nSeqID = V_R8(&rValue);

原创粉丝点击