Bug 57474

Summary: RefersToFormula for defined name changes after sheet re-order
Product: POI Reporter: Chiranjeevi Avvaru <chiranjeeviavvaru>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED DUPLICATE    
Severity: regression    
Priority: P1    
Version: 3.11-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Chiranjeevi Avvaru 2015-01-21 12:55:34 UTC
I have defined a name called DB_NAMES(table_array) refers to a sheet3 in MS-EXCEL. 
Now DB_NAMES refres to formule is =sheet3!$A$2:$B$245 

my excel has 4 sheets.

by using POI, I am deleting the sheet2 and re-creating with same name sheet2. Now the new sheet created at end. 

I am doing a re-order my using 
workbook.setSheetOrder("sheet1", 0);
workbook.setSheetOrder("sheet2", 1);
workbook.setSheetOrder("sheet3", 2);
workbook.setSheetOrder("sheet4", 3);

after that my DB_NAMES refers to formule changed to =REF!$A$2:$B$245

This is working fine in POI - 3.7 version. After upgraded to 3.11 version I got this issue. formules in the excel got corrupted.

Could you please let me know, do i need to take any other version of POI and do i need to change the code or can this be fixed in any POI version.
Comment 1 Dominik Stadler 2015-02-11 18:34:36 UTC
Can you please attach the Excel file and your source code, preferably as unit test so we can reproduce your problem?
Comment 2 Dominik Stadler 2015-12-29 08:20:31 UTC
Marking this bug as duplicate of bug 58746 as we are not having enough information to reproduce the problem here and the other bug has an easy reproducer and likely handles the same issue.

*** This bug has been marked as a duplicate of bug 58746 ***