asp.net 导出EXCEL 报错未包含 get_Range 的定义 ???
using Excel;
Application app = new Application();
if (app == null)
{
return;
}
app.Visible = false;
app.UserControl = true;
Workbooks workbooks = app.Workbooks;
_Workbook workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet
Sheets sheets = workbook.Worksheets;
_Worksheet worksheet = (_Worksheet)sheets.get_Item(1);
if (worksheet == null)
{
return;
}
worksheet.get_Range(worksheet.Cells[1, 1], worksheet.Cells[1,3]).Merge(Missing.Value); //横向合并 worksheet.get_Range(worksheet.Cells[1, 1], worksheet.Cells[1, 1]).Value2 = "导出EXCEL测试一";
Excel.Application xlApp = new Excel.Application();
Excel.Workbook workbook = xlApp.Workbooks.Add(true);
Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Worksheets[1];
Excel.Range range;
Excel.Range range2;
range = worksheet.get_Range(xlApp.Cells[1, 1], xlApp.Cells[RowCount + 1, colCount]);