using Microsoft.Office.Interop.Excel; Worksheet sheet; public void AddLink(int row, int col, string showStr, string linkAddress) { Range range = (Range)sheet.Cells[row, col]; range.Value = showStr; sheet.Hyperlinks.Add(range, linkAddress, Type.Missing, Type.Missing, Type.Missing); }
支持绝对路径和相对路径。