Steps to be followed while updating an excel file –
1. Open Existing workbook using an input stream since, we want to read content from existing file.
2. Get existing sheet then row and then cell objects for existing content that we want to update.
3. Else, Create sheet/row/cell on need.
4. Update the selected cells.
5. Open an output stream and write to workbook.
6. Close all streams and workbook objects.
Let us see an example by using the above steps :