I faced the same problem. My problem got solved after making following changed.
Try the following
a)If the file already exists create the workbook instance with the constructor passing fileInputStream paramater.
b)Close the outputStream instance after writing into the file.
© 2017, O’Reilly Media, Inc.
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.