描述:
知道宏为
ActiveSheet.Pictures.Insert( _
"C:\Documents and Settings\Administrator\My Documents\My Pictures\A.jpg"). _
Select
导入文本的函数为
bool SetCellValue(CString sRange, CString sValue)
{
Range range;
LPDISPATCH pDisp,pRange;
Worksheet ws;
TRY
{
pDisp = m_appExcel.Worksheets(COleVariant((long)1));
ws.AttachDispatch(pDisp);
pRange = ws.Range(COleVariant(sRange));
range.AttachDispatch(pRange);
range.SetValue(COleVariant(sValue));
range.ReleaseDispatch();
ws.ReleaseDispatch();
}
CATCH(COleDispatchException, e)
{
MessageBox(NULL,"不能给Excel单元格赋值!","提示信息",MB_OK);
return false;
}
END_CATCH;
return true;
}
求教将图片导入的代码