向 IXLWorksheet 中的 IXLCell 添加工具提示

Adding a tooltip to a IXLCell in a IXLWorksheet

向 IXLWorksheet 中的 IXLCell 添加工具提示的语法是什么? 我正在尝试这种方法,但它不起作用..........

    Dim xlDoc As New XLWorkbook()
    xlDoc.AddWorksheet(filename)
    Dim xlWS As IXLWorksheet = xlDoc.Worksheets(0)
    xlWS.Range("A1", "I177").Style.Font.SetFontName("Arial")
    xlWS.Range("A1", "I177").Style.Font.SetFontSize(10)
    xlWS.Range("A1", "I177").Style.Fill.BackgroundColor = XLColor.FromArgb(253, 233, 217)
    xlWS.Protect().SetSelectLockedCells(False)
    Dim rowInt As Integer = 5
    While rowInt <= 177
        xlWS.Rows(rowInt).Height = 14.25
        xlWS.Rows(rowInt).Style.Alignment.SetVertical(XLAlignmentVerticalValues.Center)
        rowInt = rowInt + 1
    End While


xlWS.Cell("H30").Hyperlink.Tooltip = "Tooltip text string goes here"

这可行,但可能有更优雅的方式来实现,例如包装评论框大小而不是手动设置尺寸

    xlWS.Cell("H30").Comment.Style.Size.SetHeight(50)
    xlWS.Cell("H30").Comment.Style.Size.SetWidth(50)
    xlWS.Cell("H30").Comment.AddText("Tooltip text 1")
    xlWS.Cell("H30").Comment.AddNewLine()
    xlWS.Cell("H30").Comment.AddNewLine()
    xlWS.Cell("H30").Comment.AddText("Tooltip text 2").Bold = True