Search code examples
c#excelepplus

How to create a link inside a cell using EPPlus


I am trying to figure out how to write a Hyperlink inside a cell using EPPlus instead of the cell containing the link text. I need it to be recognized as a link and be clickable.

Any help is appreciated.


Solution

  • The below code worked fine with me.

    string FileRootPath = "http://www.google.com";
    _Worksheet.Cells[intCellNumber, 1].Formula = "HYPERLINK(\"" + FileRootPath + "\",\"" + DisplayText + "\")";
    

    I hope this would help you.

    Happy coding!!