参考:
try
{
// which ever version of Excel was referenced to build the interop file
// should be installed on client machines
excelApp = new Excel.Application(); // create the task list on the first worksheet in the workbook
workBook = excelApp.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
ws = (Worksheet) workBook.Worksheets[1];
}
catch
{
// remove the excel references: Excel, Microsoft.Office.Core, and VBIDE and re-add
// the COM reference Microsoft Excel 10.0 Type Library.
MessageBox.Show("An incompatible version of Microsoft Excel is intalled on your system.");
return;
}
try
{
// which ever version of Excel was referenced to build the interop file
// should be installed on client machines
excelApp = new Excel.Application(); // create the task list on the first worksheet in the workbook
workBook = excelApp.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
ws = (Worksheet) workBook.Worksheets[1];
}
catch
{
// remove the excel references: Excel, Microsoft.Office.Core, and VBIDE and re-add
// the COM reference Microsoft Excel 10.0 Type Library.
MessageBox.Show("An incompatible version of Microsoft Excel is intalled on your system.");
return;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货