Josh, Thanks again for the direction. Today I looked into the direct evaluation using the path that you suggested. First off I noticed the BiffViewer shows the ExternalSheetRecord to have a XTI record to the reference name from the formula: NameXPtg:[sheetRefIndex:1 , nameNumber:1]
[EXTERNSHEET] numOfRefs = 2 refrec #0: extBook=0 firstSheet=0 lastSheet=0 refrec #1: extBook=1 firstSheet=-2 lastSheet=-2 [/EXTERNSHEET] This causes an exception with the call to get the workbook name: _workbook.getExternalSheet(nameXPtg.getSheetRefIndex()).getWorkbookName( ); The problem comes from the LinkTable class and the method: > -----Original Message----- > Hello Steve, > > Thanks for your investigation with multiple workbook evaluation. I > didn't realise that your defined-name was in the *other* workbook. > POI currently supports evaluation cross-workbook references involving > defined-names but only if they are defined in the workbook containing > the cell under evaluation. Your first example shows the unsupported > case. This functionality needs to be fixed (it shouldn't make any > difference which book has the defined name). The solution probably > involves the class WorkbookEvaluator, calling methods > getOtherWorkbookEvaluator(), and some variation of > evaluateNameFormula(). > > Assuming that the other workbook is available, direct evaluation would > be preferred over reading cached values (from CRNRecords or wherever). > This is because (for the most part) the POI evaluator supports > evaluating cells after input values have been modified. It would be > inconsistent to handle external names differently. > > If you want to pursue the CRNRecord route, we might be able to make an > API for accessing those values (similar to reading/setting cached cell > formula results). The formula evaluator could optionally use the > cached values when the external workbook is unavailable. > > regards, > Josh > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
