0
  OPCPackage opcpackage = sheet.getWorkbook().getPackage();
  int i = opcpackage.getUnusedPartIndex("/customProperty#.bin");

Im using Apache poi -3.17 and ooxml-schemas-1.3.jar and want to write Custom properties to Worksheet and Im Stuck with this Error.

The method getUnusedPartIndex(String) is undefined for the type Object

Note : getUnusedPartIndex method is compatible in latest Version of Poi i.e apache poi 4.1.2

Please Suggest an Alternative Method to getUnusedPartIndex so as to Get an unused part index based on the namePattern, which doesn't exist yet and has the lowest positive index in Apache Poi 3.17

h tushar
  • 11
  • 3
  • Why are you casting `opcpackage` to an Object? What happens when you remove this cast? – Gagravarr Dec 17 '20 at 15:19
  • @Gagravarr thank you for your inputs ! Code Has been Edited . Issue Still Exists after removing the cast – h tushar Dec 18 '20 at 04:24
  • Why are you using 3.17 not 4.1.2? What happens when you upgrade to the latest stable version? – Gagravarr Dec 18 '20 at 12:40
  • @Gagravarr Code works fine when upgraded to latest stable version !! But I needed the alternative to the method in apache poi 3.17 as we use this version currently – h tushar Dec 19 '20 at 06:31
  • Best contact whoever you pay for a support contact on Apache POI, and ask them to do you a backport. If you don't pay anyone for support, best move to the latest community supported version! Using an out-of-date and unsupported version is unwise... – Gagravarr Dec 19 '20 at 23:28

0 Answers0