///EXCEL BOOK集合,(多个文件时)
CWorkbooks excel_books_;
///当前使用的BOOK,当前处理的文件
CWorkbook excel_work_book_;
///EXCEL的sheets集合
CWorksheets excel_sheets_;
///当前使用sheet
CWorksheet excel_work_sheet_;
///当前的操作区域
CRange excel_current_range_;
///当前的字体
CFont1 excel_current_font_;
//超链接
CHyperlinks excel_links_;
excel_books_ = excel_application_.get_Workbooks();
excel_work_book_ = excel_books_.Add(covOptional);
excel_sheets_ = excel_work_book_.get_Worksheets();
int sheetCount = excel_sheets_.get_Count();
VARIANT index;
index.vt = VT_I2;
index.iVal = 2;//添加两个工作表
if(sheetCount!=3)
{
// 添加额外的工作表
VARIANT index;
index.vt = VT_I2;
index.iVal = 2;
excel_sheets_.Add(covOptional, covOptional, index, covOptional);
}
excel_work_sheet_ = excel_sheets_.get_Item(COleVariant((short)1));
MFC导出数据到excel表时,如何增加表的数量
最新推荐文章于 2024-08-04 12:02:54 发布