//设置行高
void XlsSetRowHeight(int Row, double height)
{
if (!xlsAppIsInit())
{
return;
}
CRange range;
LPDISPATCH lpDisp = NULL;
/*得到工作簿中的Sheet的容器*/
lpDisp = m_xlsAppLication.get_ActiveSheet();
CWorksheet xlsSheet;
ASSERT(lpDisp);
xlsSheet.AttachDispatch(lpDisp);
range.AttachDispatch(xlsSheet.get_Rows(),true);
range.AttachDispatch(range.get_Item(_variant_t((long)Row), vtMissing).pdispVal, true);
range.put_RowHeight(_variant_t((long)height));
range.ReleaseDispatch();
xlsSheet.ReleaseDispatch();
lpDisp = NULL;
}
excel设置行高
最新推荐文章于 2024-03-10 22:22:15 发布