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

Commented Unassigned: Formula evaluation fails with single quotes in worksheet name [9402]

$
0
0
This seems rather fundamental, but after an extensive search I can't seem to find anything related to a problem I'm having.

I'm getting a "Identifier Expected" error when trying to evaluate a formula with the worksheet name in single quotes and containing spaces:
```
string test = "IF('Income & Expense'!H34 <> \"\", 'Income & Expense'!H34, IF('Income & Expense'!H35 <> \"\", 'Income & Expense'!H35, \"\"))";
var val = multiWorkbook.Evaluate(test);
```
I simplified this to:
```
string test = "'Income & Expense'!H34";
```
and get the same "Identifier Expected" error. Removing the single quotes I get "There isn't a worksheet named Expense".

Is there another way to specify spaces in worksheet names? Or is something else going on?
Comments: Thanks for the reply. Unfortunately, I don't have any control over the worksheet names, so not sure what a workaround is. Yes, the formula works in Excel.

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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