In Excel, worksheets with spaces and/or weird characters in their names can be referred to using single-ticks. For instance: 'Profit and Loss'!A3..A5 The patch I'm submitting allows formulas to surround worksheet names with single-ticks. As a side-effect it allows one to surround regular cell references with single-ticks in certain cases. The parser seemed to be generous about these cases in general, so I assumed it would be ok. This patch was generated against the REL_2_0_RC1 tagged version. Please let me know if you'd like it against the tip of REL_2_BRANCH and/or the HEAD itself.
Created attachment 9524 [details] patch for single-ticks around worksheet names
Oh yeah, I also had problems creating the custom palette in this version. The attached patch has a one-line comment which fixed the problem for me. In createWorkbook, the palette index was being set when we didn't have a custom palette record yet. I just commented out the line and it seemed to fix the problem.
We need a unit test for it. Please do it against the (2.0) branch as opposed to an already released RC. Thanks!
Created attachment 9541 [details] UPDATED: patch for single-ticks around worksheet names against REL_2_BRANCH
Created attachment 9632 [details] UPDATED UPDATED: patch for multiple issues including the ' around sheet names patch.
I've updated the patch file (take the latest one) - it now includes the following fixes: 1) Allow ' around worksheet names in references 2) Parse and properly handle unary minus - (e.g. -A2) 3) Fix bug with parser eating leading spaces in strings (e.g. " hi" becomes "hi") 4) Fix bug with initial argument to LOOKUP and MATCH functions not having proper ptg class (REF instead of VALUE). All four issues are pretty simple code changes and all have test cases built into the FormulaParser test class. Avik - I didn't have time today to do separate diffs. Hopefully you can find you way through the one diff file. They are all pretty simple code changes and have been excercised in many different scenarios through our application Q/A process.
Applied to both branch and HEAD. Thanks a lot, Peter. Sorry for the delay.