Nick Burch-2 wrote
> On Thu, 4 Dec 2014, negatron wrote:
>> Nick Burch-2 wrote
>>> What happens if you define a link to test.xlsx before referring to it in
>>> formulas?
>>
>> What do you mean? How can I define a link to my file?
> 
> You need to use the cunningly titled "linkExternalWorkbook" method on the 
> workbook you want to then define the name on:
> https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Workbook.html#linkExternalWorkbook%28java.lang.String,%20org.apache.poi.ss.usermodel.Workbook%29

Thanks! I didn't know this method was necessary to use external references.
Unfortunately the linkExternalWorkbook method isn't implemented yet (that is
the new error I get).
It is also said: "see bug #57184".


Nick Burch-2 wrote
>> Do you mean that I have to open my Excel file with Microsoft Office and
>> create the defined name?
> 
> That is the other way - if a workbook already has a link defined to an 
> external workbook, then POI can re-use that link when defining additional 
> names or formulas to it

Problem is that I want to adapt the path to the external reference.
The named range can point to a file or another (test.xlsx or test2.xlsx)
given the inputs on the Java interface.
Each time I change the name of the file (test.xlsx), I would have to open my
Excel file (main.xlsx) and change the external reference which is not very
practical.




--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Error-defining-external-XSSFName-tp5717292p5717299.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to