开发者

How do I format a cell as hyperlink using Excel's COM API?

I have an Excel AddIn (C# IExtensibility) and need to mark a cell as having the hyperlink format. What is the best way to do this?

I think what I need to do is set a cell to the builtin style 8. But if I get Range.Style - t开发者_JS百科here is no way to set the style builtin id. How can I do this?

??? - thanks - dave


Range("A1").Style = "Hyperlink"

Note that this will only give the cell the illusion of looking like a hyperlink. To actually make it have a hyperlink, you need to go:

Sheet(1).Hyperlinks.Add Anchor:=Range("A1"),  _
    Address:="http://www.google.com", _
    TextToDisplay:="www.google.com"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜