解决方法
你没有加速你如何访问Excel文件.但是,如果您使用的是Microsoft.Office.Interop.Excel,则
here的示例可能对您有用.请注意,它在文件中打开第一页,行:(Worksheet)xlBook.Worksheets.get_Item(1)
using Excel = Microsoft.Office.Interop.Excel; object oMissing = System.Reflection.Missing.Value; Excel.ApplicationClass xl=new Excel.ApplicationClass(); Excel.Workbook xlBook; Excel.Worksheet xlSheet; string laPath = Server.MapPath(@"\excel\xl_table.xls"); xlBook = (Workbook)xl.Workbooks.Open(laPath,oMissing,oMissi ng,oMissing); xlSheet = (Worksheet)xlBook.Worksheets.get_Item(1); xlSheet.Name = "CIAO"; xlBook.Save(); xl.Application.Workbooks.Close();