Search code examples
javapermissionsapache-poixssf

Adding a XXSF Sheet with POI to an existing excel file is failing on Windows


I need to add a sheet to an existing excel file, but I don't know how to make the file im accessing r/w.

I read a large excel sheet and I simplify the data in the sheet I generate.

On linux, the program works perfectly, and adds a sheet to the excel file I need. On Windows, the program crashes because I suspect it does not have write permissions for the file which is downloaded by the user from the internet.

My question is how can I let Java write back a new sheet to the excel file I have read?


Solution

  • It turns out I was using invalid characters in the file name, thus it wasn't working on Windows but was perfectly fine on linux.