First Last

First Last

  • 1.9k
  • 40
  • 1.1k

Add hyperlink in Excel file using Open XML

Sep 12 2019 8:38 AM
I have added a sample line of code that's what i am trying to get my result. Please help if anybody have idea how to achieve this, only need using openXml library.
Hyperlink hyperlink = new Hyperlink()
Reference = "A" + indexer, Location = "Unique" + (indexer - 1) + "!A1", Display = "Unique" + indexeattributes.Add(new OpenXmlAttribute("t", null, "inlineStr"));
var cell = new Cell() { CellReference = hyperlink.Display };
//cell.InnerText = "dfd";
writer.WriteStartElement(cell, attributes);
//writer.WriteStartElement(hyperlink, attributes);
//writer.WriteElement(new InlineString(new Text("dfdfs")));
writer.WriteStartElement(new InlineString(hyperlink));

Brought to you by: JavaScript SDK for Bold BI dashboard and analytics embedding. Free trial.

Answers (4)