Created attachment 32210 [details] workbook containing hidden MASTER sheet, that I am trying to clone. public void addNewWorksheet4() { FileInputStream fileIn = null; FileOutputStream fileOut = null; int idx; int foundIdx; try { fileIn = new FileInputStream(Environment.getExternalStorageDirectory()+File.separator + "uesystems/leakmgr/MixedGasReport.xls"); POIFSFileSystem fs = new POIFSFileSystem(fileIn); HSSFWorkbook wb = new HSSFWorkbook(fs); HSSFSheet sheet = null; foundIdx = locateWorkSheetByName(wb, "master"); HSSFSheet newSheet = wb.cloneSheet(foundIdx); idx = wb.getSheetIndex(newSheet); wb.setSheetName(idx, "newName"); // Write the output to a file fileOut = new FileOutputStream(Environment.getExternalStorageDirectory()+File.separator + "uesystems/leakmgr/MixedGasReport2.xls"); wb.write(fileOut); } catch(FileNotFoundException ex) { Log.v(TAG, "FileNotFoundException: " + ex.toString()); } catch(IOException ex) { Log.v(TAG, "IOException: " + ex.toString()); } catch(Exception ex) { Log.v(TAG, "Exception: " + ex.toString()); } finally { if (fileOut != null) { try { fileOut.close(); } catch(Exception ex) { } } if (fileIn != null) { try { fileIn.close(); } catch(Exception ex) { } } } }
I am not sure how to add a clone method to ArrayRecord object. Thank you in advance for your help.
Fixed via r1647255, should be available in the next nightly build.