1.新建一個項目
2.給項目添加引用:Microsoft Excel 12.0 Object Library (2007版本)
Excel = Microsoft.Office.Interop.Excel;
3.對excel的簡單操作:如下代碼“添加超鏈接”等。
Excel = Main(= Excel.Application();
excelApp.Visible = ;
workbookPath = ;
= = excelApp.Workbooks.Open(workbookPath, , , , , , Excel.XlPlatform.xlWindows, , , , , ,
excelWorkbook =
Excel.Sheets excelSheets =
currentSheet = =
Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range(,
excelCell.Value2 = = (Excel.Worksheet)excelSheets.get_Item(= (Excel.Range)excelWorksheet2.get_Range(=
excelWorksheet.Hyperlinks.Add(excelCell,
參考:
http://support.microsoft.com/kb/302084/zh-cn
http://www.codeproject.com/Articles/5123/Opening-and-Navigating-Excel-with-C