excel 类获取起始列和使用列

m_excel.OpenWorkBook(sFileName, sSheetDrawingList);
// Get drawing info
int iStartRow = 0, iStartCol = 0, iRowNum = 0, iColNum = 0;
_ExRange range;
_ExRange usedRange;
usedRange.AttachDispatch(m_excel.GetSheet().GetUsedRange());

iStartRow = usedRange.GetRow();
iStartCol = usedRange.GetColumn();

range.AttachDispatch(usedRange.GetRows()) ;
iRowNum = range.GetCount();

range.AttachDispatch(usedRange.GetColumns()) ;
iColNum = range.GetCount();

posted @ 2016-02-26 17:22  xzh1993  阅读(243)  评论(0编辑  收藏  举报