/**
  * Produces a writable copy of the workbook passed in by
  * creating copies of each sheet in the specified workbook and adding
  * them to its own record
  *
  * @param w the workbook to copy
  */
 private void copyWorkbook(Workbook w)
 {
     int numSheets = w.getNumberOfSheets();
     wbProtected = w.isProtected();
     Sheet s = null;
     WritableSheetImpl ws = null;
     for (int i = 0; i < numSheets; i++)
         {
         s = w.getSheet(i);
         ws = (WritableSheetImpl)createSheet(s.getName(), i, false);
         ws.copy(s);
         }
 }