我用的是CSpreadSheet类读取EXLCEL,总是有几个字段读出来为空
代码如下:
CSpreadSheet SS( "显示内容.xls", _T("2-1.5"), false );
CStringArray Rows, Column;
CString str;
LEDProduction_line yy;
int total = SS.GetTotalRows();
memset( &yy, 0, LEDProduction_line_SIZE );
// 读取一行
SS.ReadCell( str, 1,4 ); //零件号
memcpy(yy.Part_number,str,str.GetLength());
SS.ReadCell( str, 2,4 ); //零件名称
memcpy(yy.Part_name,str,str.GetLength());
SS.ReadCell(str,3,4 ); //计划产量
yy.yield = atoi(str);
SS.ReadCell(str, 4,4 ); //可动率
yy.Movable_rate = atoi(str);
SS.ReadCell(str, 5,4 ); //计划SPH
yy.Plan_sph = atoi(str);
SS.ReadCell(str, 6,4 ); //实际完成
yy.Complete = atoi(str);
SS.ReadCell(str, 7,4 ); //实际SPH
yy.Actual_sph = atoi(str);
SS.ReadCell(str, 8,4 ); //当前SPH
yy.Current_spm = atoi(str);
yy是我自己建的一个结构,可动率读出来始终为空,我读取一行也是为空,在值前面加个字母就能读出来了,例如a22,不是纯数字就可以,之前我是纯数字可以读,字母和数字组合不能读,请大虾赐教!