c++ 操作Execl根据行号删除指定行

void ExcelFile::DeleteRow(long iRow)
{
    CRange start_range = excel_work_sheet_.get_Range(COleVariant("A1"),covOptional);
    CRange write_range = start_range.get_Offset(COleVariant((long)(iRow -1)), COleVariant((long)1));
    CRange del_range = write_range.get_EntireRow();
    del_range.Delete(COleVariant(-4162L));
    start_range.ReleaseDispatch();
    write_range.ReleaseDispatch();
    del_range.ReleaseDispatch();
}

你可能感兴趣的:(c++ 操作Execl根据行号删除指定行)