if( !app.CreateDispatch(_T("Excel.Application"))){MessageBox(_T("无法创建Excel应用!"));return;}app.put_Visible(TRUE);app.put_UserControl(TRUE);books=app.get_Workbooks();book=books.Add(COleVariant(_T("E:\\c.xls")));sheets=book.get_Sheets();sheet=sheets.get_Item(COleVariant((short)1));//range = sheet.get_Range(COleVariant(_T("A")),COleVariant(_T("A")));range = sheet.get_Range(COleVariant(_T("A1")),COleVariant(_T("A1")));range = range.get_End(xlDown);lRowCount = range.get_Row();str1.Format(_T("D%d"),lRowCount);range=sheet.get_Range(COleVariant(_T("A1")),COleVariant(str1));CChartObjects chartObjects;//chartObjects.AttachDispatch(sheet.ChartObjects(covOptional));chartObjects = sheet.ChartObjects(covOptional);CChartObject myChart = chartObjects.Add(120, 40, 400, 250);CChart chart=myChart.get_Chart();chart.put_ChartType(xlColumnClustered);chart.SetSourceData(range,COleVariant((long)xlColumns));chart.ApplyDataLabels(0,covOptional,covOptional,covOptional,covOptional,covOptional,covTrue,covOptional,covOptional,covOptional);chart.put_HasTitle(TRUE);CChartTitle chartTitle = chart.get_ChartTitle();chartTitle.put_Text(_T("相比看新开传奇网站图表制作示例"));font = chartTitle.get_Font();font.put_Size(COleVariant((long)20));font.put_ColorIndex(COleVariant((long)3));font.put_Name(COleVariant(_T("华文新魏")));CChartArea chartArea = chart.get_ChartArea();想知道sheetsCnterior interior = chartArea.get_Interior();interior.put_ColorIndex(COleVariant((long)8));interior.put_PatternColorIndex(COleVariant((long)1));interior.put_Pattern(COleVariant((long)xlSolid));CPlotArea plot学会找sf网站刚开一秒Area = chart.get_PlotArea();interior = plotArea.get_Interior();interior.put_ColorIndex(COleVariant((long)35));interior.put_PatternColorIndex(COleVariant((long)1));interior.put_Pattern(COleVariant((long)xlSolid));CSeries series = chart.SercworksheetsiesCollection(COleVariant((long)1));CDatsf999发布网 aLabels dataLabels = series.DataLabels(covOptional);dataLabels.Delete();series = chart.SeriesCCWorksheetsollection(COleVariant((long)2));dataLabels = series.DataLabels(covOptional);font = dataLabels.get_Font();CWorksheetsfont.put_Size(COleVariant((long)10));font.put_ColorIndex(COleVariant((long)5));
book.SaveAs(COleVariant(_T("E:\\b.xls")),covOptional,covOptional,covOptional热血传奇中变,covOptional,covOptional,1,covOptional,c好sf发布网ovOptional,covOptional,covOptional,covOptional);book.Close(covOptional,covOptional,covOptional);books.Close();
COleVariantcovTrue((short)TRUE),covFalse((short)FALSE),covOptional((long)DISP_E_PARAMNOTFOUND,想知道新开传奇网站 VT_ERROR);
CApplication app;CWorkbooks books;CWorkbook book;CWorksheets sheets;CWorksheet sheet;CRange range;CFont0 font;CRasheetsnge cols;int i = 3;CString str1, str2;long lRowCount;
sf999发布网 新开传奇合击版本网站
学会新开传奇合击版本网站
想知道sf999发布网
事实上新开传奇网站
新开传奇网站
听听sheets
zhaosf发布网你看sf999发布网