In case anyone is interested, here's how I updated the tables successfully:

opcPackage = OPCPackage.open(file);
List<PackagePart> parts =
opcPackage.getPartsByName(Pattern.compile("/xl/tables/.*\\.xml"));
      
for (int i = 0; i < (parts != null ? parts.size() : 0); i++)
{
      PackagePart part = parts.get(i);          
      TableDocument td = TableDocument.Factory.parse(part.getInputStream());
      CTTable ctt = td.getTable();
      CTAutoFilter ctaf = ctt.getAutoFilter();          
      ctt.setRef("A1:I"+reLastRow);
      ctaf.setRef("A1:I"+reLastRow);                            
      OutputStream os = part.getOutputStream();
      td.save(os);
      os.close();
}
opcPackage.close();



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Altering-a-Table-through-XSSF-Event-API-tp5712708p5712711.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to