How to delete sheet from an existing excel file using JExel

658 views Asked by At

I am trying to delete sheet from an existing excel file. can any one suggest how to do that.

1

There are 1 answers

0
maximdim On

It depends what you're trying to achieve.

Brute force method: the never Excel file format (*.XLSX) is just a zipped folder with bunch of XML files inside. One of the file describes worksheets included in document. What you could do is to unzip it, change that file to include only worksheets you need and zip it back. Upon opening such modified file Excel would complain but other tools, such as Apache POI would work just fine and you could seriously reduce memory consumption on large documents by excluding worksheets you don't need.

Perhaps there is a more elegant way.