hi, thank you a lot for your reply.

I try your suggestion but that doesn't work...

my example for reading :

InputStream inp = new FileInputStream(file);
HSSFWorkbook wb = new HSSFWorkbook(inp);

HSSFName name = wb.getName("MySheet!aLibellé");
                            
                            if(name != null)
                                System.out.println("RefersFormula 
"+name.getRefersToFormula());
                            else
                                System.out.println("name is null");

when i try with MySheet!aLibellé i have name null and when i try without
MySheet! it's return me the aLibellé adress but in wrong sheet


my example for writting :


                            HSSFName namedCell = wb.createName();
                            namedCell.setNameName("id_product");
                            String reference = "sheet1!$A$1"; // area reference
                            namedCell.setRefersToFormula(reference);
                    
                            Name namedCell2 = wb.createName();
                            namedCell2.setNameName("id_product");
                            String reference2 = "sheet2!$A$1"; // area reference
                            namedCell2.setRefersToFormula(reference2);

this code throw an exception :
java.lang.IllegalArgumentException: The workbook already contains this name:
id_product


thank youu


--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Same-named-cells-in-several-sheets-tp5683541p5685173.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