最近发布的主题
最近发布的文章
暂无
最近分享的资源
暂无
最近发布的项目
暂无
最近的评论
-
谢谢 dawing38的指点! 下面分享下问题解决过程 我链接的是另一个sheet页 经过尝试我发现有以下三种方式实现链接到另一个sheet页: 1.xlsx.SetCellValue("sheet2", "A2", "hello world.") xlsx.SetCellHyperLink("sheet2", "A2", "#Sheet1!A1") 2.xlsx.SetCellValue("sheet2", "E2", "=HYPERLINK(\"#Sheet1!A1\",\"linkname\")")// 3.xlsx.SetCellFormula("Sheet2", "C2", "=HYPERLINK(\"#Sheet1!A1\",\"linkname\")") 使用第三种之后我发现其实"github.com/tealeg/xlsx"这个库也是支持超链接的: cell.SetFormula("=HYPERLINK(\"#Sheet1!A1\",\"aaa\")") style := cell.GetStyle() style.Font.Underline = true //加下划线 style.Font.Color = "FF0000FF"//设置字体颜色为蓝色 cell.SetStyle(style) 不过我还是没弄明白 SetCellHyperLink(sheet, axis, link string) 中的link字符到底该怎么写是标准写法 因为我发现使用SetCellHyperLink时,超链接设置为网址时 生成的超链接打不开,不多幸好我链接的是另一个sheet页。 希望知道的高手们再给指点下吧