c# - How to add values, containing double quotes, from DataTable rows values to Excel cells formulas? -
i'm newbie in c#. tried insert strings datatable excel cells formulas, unsuccesfully. example, have
=round(r[-2]c*if(r[-1]c="";r[-1]c17;r[-1]c)/(if(r[-1]c="";r[-1]c17;r[-1]c));2)
as value. tried make
=round(r[-2]c*if(r[-1]c=\"\";r[-1]c17;r[-1]c)/(if(r[-1]c=\"\";r[-1]c17;r[-1]c));2)
but got exception hresult: 0x800a03ec in last example debugger shows proper string, got exception.
also, works, when put code:
globals.wirksheet1.cells.range["a100"].value2 = @"=round(r[-2]c*if(r[-1]c="""",r[-1]c17,r[-1]c)/(if(r[-1]c="""",r[-1]c17,r[-1]c)),2)";
but need values datatable, don't know how add @ string. please, explain me how solve problem? thanks
for sake of answer.
op has stated:
i changed values in table data
=round(r[-2]c*if(r[-1]c=concatenate(char(34),char(34)),r[-1]c17,r[-1]c)/(if(r[-1]c=concatenate(char(34),char(34)),r[-1]c17,r[-1]c)),2)
Comments
Post a Comment