Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
685
Cell with Hyperlink
posted

Hello,

I have an excel table and one of the columns contains reference to a file on the computer file system. I have to link the cell value to that file, so when you click the cell the file opens.

I know that to do this i have to use the APPLYFORMULA in this way

 

xFoglio.Rows(rownumber).Cells(columnnumber).ApplyFormula("=HYPERLINK("C:\MyFile.txt";"MyFile.txt")")

 

It works, but there is only one problem: the value of the cell is "MyFile.txt" but it is not showed as an hyperlink (I mean, it is not underlined and not in blue color), it appears as normal text. To obtain the hyperlink you have to select the cell and press enter.

So the cell actually behaves like an hyperlink (if you click the cell the file is opened) but it is not showed as an hyperlink

 

Claudio Di Flumeri

Parents
  • 469350
    Offline posted

    Hi Claudio,

    I tried this out in Excel using the HyperLink function and it does display as a link to me (underlined blue text). So I can only assume that something in your code is doing something to change the appearance of the cell.

    How exactly are you creating the Excel file? You are posting in the Excel forum, but your code appears to be referencing a grid cell. Is this WinGrid or WebGrid? Are you using the Infragistics UltraGridExcelExporter?

    If you are using the exporter component, then I'm guessing that the exporter itself is overwriting the Style of the cell so that it looks like the cell in the grid and this is overriding the default link appearance in Excel.

    If that's the case, then I think you could prevent this by canceling the export of the cell using an event on the Exporter (which is probably what you are using to set the formula in the first place). But this is only a guess, there's not enough information here for me to be sure.

Reply Children