Add hyperlinks in Excel, you can use the hyperlink formula, that is, =hyperlink (Src,display);
In the example in StackOverflow: http://stackoverflow.com/questions/2905633/add-hyperlink-to-cell-in-excel-2007-using-open-xml-sdk-2-0
New Cellformula () {Space =@ "HYPERLINK (" "Http://www.theclash.com" "," "Radio Clash" ")" ;
In the above method, the @ means that the string after it can be treated as a normal string, regardless of the escape that might be thrown by the backslash. The double quotation marks included in the normal string are represented by 2 double quotation marks.
However, when you replace a link with a variable, it is not advisable, and the key is the limit of the @ usage.
You can use string concatenation directly, and for double quotes, escape characters with backslashes.
url= " http://www.theclash.com ";
Txt=string.concat ("HYPERLINK (\" ", url," \ ", \" Radio clash\ ")");
qa:c# text string Insert double quotation marks: @ Usage and backslash usage