日期:2014-05-17 浏览次数:20469 次
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;
&nbs