-1
以下语法将工作表添加到新工作簿,我如何将其添加到同一工作簿?将工作表添加到当前工作簿
private void AddWorksheetsAndCopyData()
{
xlApp = new Excel.Application();
xlApp.Visible = true;
Excel.Worksheet addedSheet;
string filePath = @"C:\sample.xlsx";
xlWorkBook = xlApp.Workbooks.Open(filePath);
//checking if cell value is null - if it is not adding worksheet to copy data to
xlWorkBook = xlApp.Workbooks.Add(misValue);
addedSheet = (Excel.Worksheet)xlWorkBook.Worksheets.Add();
range.Copy(newSeet.Range["A1"]);
}
为什么向下票呢?我提供了我试过的语法,并清楚地描述了问题,,, –