Excel.Application app = new Excel.Application();
if (app == null)
{
return;
}
app.Visible = false;
app.UserControl = true;
Excel.Workbooks workbooks = app.Workbooks;
Excel._Workbook workbook = workbooks.Add(TempPath + TemplateCode.ToString() + ".xls");
Excel.Sheets sheets = workbook.Worksheets;
Excel._Worksheet xlsheet = (Excel._Worksheet)sheets.get_Item(1);
workbook.Worksheets 有activesheet属性,或者你根据 get_Item函数来获取