Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: calc value from NamedRange between different worksheet

$
0
0
Hi,this is not the result that I want and please do me a favor. :-D
Example,
[Case A]
In Sheet1 has Named cell ,_tmpResult (Address:A1),_tmpA (Address:B1,value:1) ,_tmpB(Address:C1,value:2)
and _tmpResult forluma is "=_tmpB+_tmpA" then get the result is 3, it works ok.
[Case B]
But when put the cell _tmpB,_tmpA into Sheet2,and the _tmpResult also in the Sheet1 then read the value from named cell _tmpResult from the closedXML will throw a exceptipn(System.NullReferenceException).

Part code:
worksheet.Cell("_tmpResult").Value; (Case A works well,but wrong in Case B)

What can i do to calc the value ok? I have such lot this in my excel,thank U

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>