https://issues.apache.org/bugzilla/show_bug.cgi?id=56114

            Bug ID: 56114
           Summary: setAsActiveCell doesn't (always) work
           Product: POI
           Version: 3.9
          Hardware: PC
                OS: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: [email protected]
          Reporter: [email protected]

The method setAsActiveCell doesn't set the focus on the cell.

If you open Excel, it shows another cell (e.g. A1).

There's no difference between creating a new workbook and reading an existing
xls file. The method doesn't set the cell active or it does but Excel ignores
the selection?

Simple Test case with a new workbook:

Workbook wb = new HSSFWorkbook();
Sheet sh = wb.createSheet();

sh.createRow(0);
sh.createRow(1);
sh.createRow(2);
sh.createRow(3);

Cell cell = sh.getRow(1).createCell(3);
sh.getRow(3).createCell(3);

cell.setAsActiveCell();

FileOutputStream fos = new FileOutputStream("C:\\test.xls");

wb.write(fos);

fos.close();

//FileViewer.open("C:\\test.xls");

wb = WorkbookFactory.create(new File("C:\\test.xls"));
wb.getSheetAt(0).getRow(3).getCell(3).setAsActiveCell();

fos = new FileOutputStream("C:\\test2.xls");

wb.write(fos);

fos.close();

//FileViewer.open("C:\\test2.xls");


Above code works if you use new XSSFWorkbook() and "xlsx" as extension.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

Reply via email to