VC?н??????????Excel?????
???????????? ???????[ 2014/7/22 10:38:36 ] ????????VC ?????
??????????????????????COM??????
????1????OnInitDialog()?????г????COM????
????<span style="white-space:pre"> </span>SetIcon(m_hIcon?? TRUE); // ????????
????SetIcon(m_hIcon?? FALSE); // ????С???
????// TODO: ??????????????????
????::CoInitialize(NULL); //?????COM????
????return TRUE; // ????????????????????????? TRUE
????2??????OnDestroy??????????????COM?????????????
????void CExportExcelDlg::OnDestroy()
????{
????CDialog::OnDestroy();
????::CoUninitialize(); //???COM????
????}
????????Excel???????
????????????Excel????????????????Add Class->From a type library????Excel???·???????EXCEL.exe??????????Щ???????????_Application??Workbooks??_Workbook??Worksheets??_Worksheet??Range????(???????VS2103???????Щ????????????????(.h)?????.cpp?????????Щ???????????????????????????£????????????ò??????????????????????VC6.0?????????????????????????????????????к??????????????????)??
???????????????excel???
?????????ü???Excel??????????????????????Debug??????н??????Excel??????????template.xls
?????????????Button?????????????????ú???????????????£?
<span style="white-space:pre"> </span>Range m_ExlRge;
_Worksheet m_ExlSheet;
Worksheets m_ExlSheets;
_Workbook m_ExlBook;
Workbooks m_ExlBooks;
_Application m_ExlApp;
COleVariant covTrue((short)TRUE)?? covFalse((short)FALSE)?? covOptional((long)DISP_E_PARAMNOTFOUND?? VT_ERROR);
|
?????塢????Excel????
????<span style="white-space:pre"> </span>if (!m_ExlApp.CreateDispatch(L"Excel.Application"?? NULL)) ///??m_ExlApp??????Excel????
????{
????AfxMessageBox(L"????Excel???????!");
????return;
????}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11