Hi, It should be possible to remove these pieces via the low-level POI APIs for Relationships/Parts on the XSSFWorkbook before you write out the XSLX, however I don't know the code well enough to state how exactly you would go about that.
Dominik. On Fri, Feb 26, 2016 at 5:31 PM, Christian Reuter < [email protected]> wrote: > Hi there, > > > I am working with XSSFTable and CTTable in my workbooks. > My program opens an .xlsx - template file with POI in order to delete and > recreate some of the sheets in this file and save it as a new file. > > The problem is that the deleted sheets as well as the new sheets created > programmatically may contain tables. Unfortunately if there are tables > defined in the deleted sheets they are not deleted when the sheet is > deleted. > I therefore get ID conflicts later if one of my newly created tables has > the same ids as one of the tables which have been left over from the sheet > deletions. > > The only way I see to remove the existing tables is to open the zip file > before reading it as a workbook and deleting the contents of the subfolder > "xl\tables" which contains the table definitions. > > Can somebody help me to find a better solution please? > If not: can someone provide a code snippet for the above mentioned > low-level manipulation of the file? > > Thx, > > Christian >
