c#的Excel编程,合并单元格失败 10
Excel.Applicationexcel=newExcel.Application();Excel.WorkbooksworkBooks=excel.Workbook...
Excel.Application excel = new Excel.Application();
Excel.Workbooks workBooks = excel.Workbooks;
Excel.Workbook workBook = workBooks.Add(Excel.XlWBATemplate.xlWBATWorksheet);
Excel.Worksheet workSheet = (Excel.Worksheet)workBook.Worksheets[1];
if (workSheet != null)
{
Range range = workSheet.get_Range(workSheet.Cells[1,1], workSheet.Cells[1,3]);
range.Merge(true);
}
不知道哪里错了 请师兄指点 展开
Excel.Workbooks workBooks = excel.Workbooks;
Excel.Workbook workBook = workBooks.Add(Excel.XlWBATemplate.xlWBATWorksheet);
Excel.Worksheet workSheet = (Excel.Worksheet)workBook.Worksheets[1];
if (workSheet != null)
{
Range range = workSheet.get_Range(workSheet.Cells[1,1], workSheet.Cells[1,3]);
range.Merge(true);
}
不知道哪里错了 请师兄指点 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询