当前位置: 代码迷 >> ASP.NET >> 怎么通过ASP.NET来打开excel文件
  详细解决方案

怎么通过ASP.NET来打开excel文件

热度:4932   发布时间:2013-02-25 00:00:00.0
如何通过ASP.NET来打开excel文件.
意思就是通过一个WEB页面的BUTTON来打开一个指点路径下的excel文件

------解决方案--------------------------------------------------------
Excel.Application app;
Excel.Workbook workBook;
Excel.Worksheet workSheet;

app = new Excel.ApplicationClass();
app.Visible = true;
workBook = app.Workbooks.Open(strFullFileName,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
workSheet = (Excel.Worksheet)workBook.Sheets.get_Item(1);
//strFullFileName为路径
  相关解决方案