=> Create an excel file, say destn.xls with a column which has reference to another excel file say source.xls (Give complete path to the source.xls - something like - "=VLOOKUP(A1,'C:\[Source.XLS]Sheet1'!$A$2:$B$3,2,0)") => Execute the following code: java.io.FileInputStream fs= new java.io.FileInputStream("C:/test/Destn.xls"); org.apache.poi.ss.usermodel.Workbook wb = org.apache.poi.ss.usermodel.WorkbookFactory.create(fs); org.apache.poi.ss.usermodel.Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(1); org.apache.poi.ss.usermodel.Cell cell = row.getCell(1);//assuming this cell has the vlookup formula in your excel file if(cell != null && cell.getCellType()==Cell.CELL_TYPE_FORMULA) { System.out.println("Cell formula:"+cell.getCellFormula()); } It gives result as VLOOKUP(A1,'[Source.XLS]Sheet1'!A:B,2,0) The issue is because org.apache.poi.hssf.record.SupBookRecord.decodeFileName(String) does not seem to be implemented fully
Created attachment 26005 [details] File dst2.xls - contains a column2 with cell values linked to anohter workbook src1.xls
Created attachment 26006 [details] Src1.xls is referred to from dst2.xls
The patch in Bug 52576 fully implements SupBookRecord.decodeFileName.
The problem should be fixed in r1242701 Yegor