VC?н??????????Excel?????
???????????? ???????[ 2014/7/22 10:38:36 ] ????????VC ?????
??????????????·????????壬?????????excel??
<span style="white-space:pre"> </span>wchar_t path[MAX_PATH];
GetCurrentDirectory(MAX_PATH?? path);
CString strPath = path;
strPath += "\template";<span style="white-space:pre"> </span>//??????·??
m_ExlBooks.AttachDispatch(m_ExlApp.GetWorkbooks()?? TRUE);
m_ExlBook.AttachDispatch(m_ExlBooks.Add((_variant_t)strPath)?? TRUE); //????EXCEL???
m_ExlSheets.AttachDispatch(m_ExlBook.GetSheets()?? TRUE); //????Sheet???
m_ExlSheets.Add(vtMissing?? vtMissing?? _variant_t((long)1)?? vtMissing); //????μ?Sheet???
m_ExlSheet.AttachDispatch(m_ExlSheets.GetItem(_variant_t((long)2))?? TRUE); //????????Sheet???
m_ExlSheet.Delete();
m_ExlSheet.AttachDispatch(m_ExlSheets.GetItem(_variant_t((long)1))?? TRUE); //??????Sheet??????????TestSheet
m_ExlSheet.SetName(L"TestSheet");
///???????е????A1??D1///
m_ExlRge.AttachDispatch(m_ExlSheet.GetRange(_variant_t("A1")?? _variant_t("D1"))?? TRUE); //??????????????
m_ExlRge.Merge(_variant_t((long)0));
///??????????///
m_ExlRge.AttachDispatch(m_ExlSheet.GetCells()?? TRUE); //???????е????
m_ExlRge.SetItem(_variant_t((long)1)?? _variant_t((long)1)?? _variant_t("??????????γ?"));
m_ExlRge.SetItem(_variant_t((long)2)?? _variant_t((long)1)?? _variant_t("?γ???"));
m_ExlRge.SetItem(_variant_t((long)2)?? _variant_t((long)2)?? _variant_t("???"));
m_ExlRge.SetItem(_variant_t((long)2)?? _variant_t((long)3)?? _variant_t("???"));
m_ExlRge.SetItem(_variant_t((long)2)?? _variant_t((long)4)?? _variant_t("??????"));
m_ExlRge.SetItem(_variant_t((long)3)?? _variant_t((long)1)?? _variant_t("c????"));
m_ExlRge.SetItem(_variant_t((long)3)?? _variant_t((long)2)?? _variant_t("60"));
m_ExlRge.SetItem(_variant_t((long)3)?? _variant_t((long)3)?? _variant_t("???"));
m_ExlRge.SetItem(_variant_t((long)3)?? _variant_t((long)4)?? _variant_t("???????"));
m_ExlRge.SetItem(_variant_t((long)4)?? _variant_t((long)1)?? _variant_t("c????γ????"));
m_ExlRge.SetItem(_variant_t((long)4)?? _variant_t((long)2)?? _variant_t("10"));
m_ExlRge.SetItem(_variant_t((long)4)?? _variant_t((long)3)?? _variant_t("??"));
m_ExlRge.SetItem(_variant_t((long)4)?? _variant_t((long)4)?? _variant_t("???"));
m_ExlRge.SetItem(_variant_t((long)5)?? _variant_t((long)1)?? _variant_t("??????"));
m_ExlRge.SetItem(_variant_t((long)5)?? _variant_t((long)2)?? _variant_t("60"));
m_ExlRge.SetItem(_variant_t((long)5)?? _variant_t((long)3)?? _variant_t("????"));
m_ExlRge.SetItem(_variant_t((long)5)?? _variant_t((long)4)?? _variant_t("???????"));
m_ExlRge.AttachDispatch(m_ExlSheet.GetUsedRange()); //??????????????
m_ExlRge.SetWrapText(_variant_t((long)1)); //??????????????????????
//??????????????????
//?????????=1??????=-4108????=-4131????=-4152
//??????????=2??????=-4108????=-4160????=-4107
m_ExlRge.SetHorizontalAlignment(_variant_t((long)-4108));
m_ExlRge.SetVerticalAlignment(_variant_t((long)-4108));
|
??????????沢???
<span style="white-space:pre"> </span>CFileDialog dlg(FALSE);<span style="white-space:pre"> </span>//????????FALSE??????棬TRUE?????
if (dlg.DoModal() == IDOK)
{
strPath = dlg.GetPathName();
m_ExlSheet.SaveAs(strPath?? vtMissing?? vtMissing?? vtMissing?? vtMissing?? vtMissing?? vtMissing?? vtMissing?? vtMissing?? vtMissing);
//m_ExlApp.SetVisible(TRUE);
}
m_ExlBook.Close(covFalse?? covOptional?? covOptional);
m_ExlBooks.Close();
m_ExlApp.Quit(); //???????
m_ExlRge.ReleaseDispatch(); //???????????????
m_ExlSheet.ReleaseDispatch();
m_ExlSheets.ReleaseDispatch();
m_ExlBook.ReleaseDispatch();
m_ExlBooks.ReleaseDispatch();
m_ExlApp.ReleaseDispatch(); //m_ExlApp??????????????????????????excel?????????????У???????????е????????
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
?????????????????????????Щ????????????????????TC???????????????Щ???????????????????????????????????????????????(java .net ?????)???mysql???????????????????ж????д???Python???????????????(DB2)??????BufferPool????????????????????????????????6??????????????????滮???????????????-????????SQL Server???????????????????λ?????PHP??SQL????????????????????Pythonд???NoSQL????????? SQL ?е????????????? SQL ?е?????????Java???????:?????MySQL???????
???·???
??????????????????
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????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????