excel设置行高

//设置行高
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;
}

 

你可能感兴趣的:(VC)