Hello Steve, >From what I can tell you are on the right track. I guess you are using NameXPtg._nameNumber to locate the correct item from LinkTable.ExternalBookBlock._externalNameRecords. These records not only have the name of the defined-name name but also the the formula tokens, however I think you are more correct in resolving the formula via the other workbook (as the code above seems to suggest).
I am intrigued by the -2 sheet index values. I wonder if '-2' is a special distinguished value besides '-1', or whether the negated value (+2) has some relevance. This code might need changing: refWorkbookEvaluator.evaluateNameFormula(ptgs,this); There might be a problem with the scope of the OperationEvaluationContext (second param, 'this'). It is supposed to know the location of the cell under evaluation. Cell evaluation is recursive and every time a new cell is visited, a new OEC is created. I'm still not sure whether a separate context should be required when evaluating defined names. At the moment, there doesn't seem to be an issue because POI only supports evaluation of names that directly translate into cell references. If POI were to support more complex name evaluation this might change. In any case, it seems to be odd to be passing an OEC from a calling workbook into the other workbook evaluator. Maybe this is a sign of redundancy in the design. Perhaps we could experiment a little with formulas involving defined names to get a better feel of where the evaluation context boundaries seem to be. hope this helps, Josh --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
