- 积分
- 815
- 明经币
- 个
- 注册时间
- 2004-10-8
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-4-6 15:50:00
|
显示全部楼层
Workbooks.AttachDispatch(ExcelApp.GetWorkbooks()); Workbook.AttachDispatch(Workbooks.Open(FileName,covOptional, covOptional,covOptional, covOptional,covOptional, covOptional,covOptional, covOptional,covOptional, covOptional,covOptional, covOptional)); Worksheets.AttachDispatch(Workbook.GetWorksheets()); Worksheet.AttachDispatch(Worksheets.GetItem((COleVariant((long)1))));
Range.AttachDispatch(Worksheet.GetCells()); iCell.AttachDispatch(Range.GetItem(COleVariant((long)2),COleVariant((long)2)).pdispVal);
vResult = iCell.GetMergeCells();
if(vResult.boolVal == -1) { AfxMessageBox("Yes"); Range.AttachDispatch(iCell.GetRows()); long row_num = Range.GetCount();
Range.AttachDispatch(iCell.GetColumns()); long col_num = Range.GetCount();
CString str; str.Format("%d×%d",row_num,col_num); AfxMessageBox(str); }
请教:为什么str得到的结果都是1×1?(求合并单元格的原始行数和列数)。
谢谢。。。。。。。。。。 |
|