//得到列的总数 int IllusionExcelFile::GetColumnCount() { CRange range; CRange usedRange; usedRange.AttachDispatch(excel_work_sheet_.get_UsedRange(), true); range.AttachDispatch(usedRange.get_Columns(), true); int count = range.get_Count(); usedRange.ReleaseDispatch(); range.ReleaseDispatch(); return count; }
//得到列的总数 long Illusion_ExcelFile::column_count() { CRange range; CRange usedRange; usedRange.AttachDispatch(excel_work_sheet_.get_UsedRange(), true); range.AttachDispatch(usedRange.get_Columns(), true); long count = range.get_Count(); usedRange.ReleaseDispatch(); range.ReleaseDispatch(); return count; }