Prova a chiudere il file

if(workbookErr==null)throw new Exception("error");
workbookErr.write();
workbookErr.close();