Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Created Unassigned: Injecting a date into string via named range gives invalid operation exception [12757]

$
0
0
Hi all,

I've been struggling with this issue for 2 days now and I haven't come up with a way to get around it.

I have a cell in a .xls which I try to read but I get an InvalidOperationException: Cannot get text value from a error formula cell.

Here is my cell formula:
="SELECT * FROM DATA_EQUITY WHERE FORMAT(Field1, 'yyyy/MM') >= '"&TEXT(TodayDate, "yyyy/MM")&"'"

TodayDate is points to a named range containing a date formatted to yyyy/MM

In excel all looks fine but when I run the code to read the cell string value I get the exception.
In code CellFormula returns:
"\"SELECT * FROM DATA_EQUITY WHERE FORMAT(Field1, 'yyyy/MM') >= '\"&Month1&\"'\""
and CellType is Formula

Am I missing something or what is going on?

Viewing all articles
Browse latest Browse all 1621

Trending Articles



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