@tkurian,
It seems ‘|’ is the separator of parameters for formula for your region. If so, you need some special work to get the expected result.
Commonly we only support to set the standard formula expressions for cell. Same with regional settings of en_US, the separator of parameters should be ‘,’.
If you do need to use the special formula expression of specific region, you may try the LocaleDependent option. Code example:
cell.SetFormula("=HYPERLINK(ENCODEURL(\"\\server\\share\\test.pdf\")|\"\\server\\share\\test.pdf\")",
new FormulaParseOptions() { LocaleDependent = true }, null) ;
And please make sure the list separator of workbook’s regional setting is ‘|’. If not, please specify the correct regional settings for the workbook or your default cultureinfo to make sure the separator is ‘|’.
Or, you may implement your own GlobalizationSettings to specify the separator as ‘|’. Code example:
class MG : GlobalizationSettings
{
public override char ListSeparator
{
get { return '|'; }
}
}
workbook.Settings.GlobalizationSettings = new MG();
And currently we do not support ENCODEURL function, so in the generated file this function maybe cannot work correctly when opening it with ms excel. If you need, we may create one ticket for your requirement and try to support it.