我已经把数据导入到excel中,取名为sheet1,现在想在创建一个空白的sheet2放导出的图表,再创建一个名为sheet2的表不知应该怎么写,请大家帮忙,谢谢!主要是想把 ExcuteExcel.ActiveChart.Location(Excel.XlChartLocation.xlLocationAsObject,"sheet1");中的sheet1改为sheet2,
但有不知道怎么生成一个空白的sheet2
代码如下
Excel.Application ExcuteExcel=new Excel.ApplicationClass();

ExcuteExcel.Workbooks.Add(true);

oSheet = (Excel._Worksheet)ExcuteExcel.ActiveSheet;


oSheet.Cells[1,1]="失效模式";
oSheet.Cells[1,2]="百分比"; oSheet.Cells[1,9]=tryield;
oSheet.Cells[2,9]=ACYIELD;

ExcuteExcel.Charts.Add(Missing.Value,Missing.Value,1,Missing.Value); 
ExcuteExcel.ActiveChart.ChartType=Excel.XlChartType.xlColumnClustered;
ExcuteExcel.ActiveChart.SetSourceData(oSheet.get_Range("A1","B10"),Excel.XlRowCol.xlColumns);

ExcuteExcel.ActiveChart.Location(Excel.XlChartLocation.xlLocationAsObject,"sheet1");
ExcuteExcel.ActiveChart.HasTitle=true;
ExcuteExcel.ActiveChart.ChartTitle.Text="图表名称";
ExcuteExcel.ActiveChart.HasDataTable=false;

//add SaveFileDialog saveRegFile = new SaveFileDialog();
saveRegFile.Filter = "Microsoft Excel File(*.xls)|*.xls";
saveRegFile.DefaultExt = "*.xls";
saveRegFile.ShowDialog();
if(saveRegFile.FileName!="")
{
ExcuteExcel.ActiveWorkbook.SaveAs(saveRegFile.FileName,Excel.XlFileFormat.xlExcel9795,null,null,false,false,Excel.XlSaveAsAccessMode.xlNoChange,null,null,null,null,null);
ExcuteExcel.Quit();
ExcuteExcel=null;

}