0

I just started using the new POI 3.6 http://poi.apache.org XSSF which was released in December 2009. The updated API provides support for reading and writing in the OOXML spreadsheet format (.xslx) with Java. So far I've been pretty impressed with the API and haven't really encountered any issues with it.

What issues or gotchas have you encountered working with the 3.6 API if any?

James
  • 12,636
  • 12
  • 67
  • 104

1 Answers1

1

i got a problem with password protected excel files, it directly throws the exception. i want to tell theuser that file is password protected but at the first place itself i get the exception. This is wat i did after taking the file.

if( wbook1.isWriteProtected() ) {
        System.out.println(" File is Password protected ");
        return false;
}
Curtis
  • 101,612
  • 66
  • 270
  • 352
mera
  • 26
  • 1
  • The exception is thrown when the `isWriteProtected()` method is called, so it's not really an issue/gotcha with the API, but a code problem...Just replace with `try{if(wbook1.isWriteProtected()) throw new Exception("File is protected.");} catch(Exception ex){System.err.println(ex.getMessage());}` and your program won't terminate because of that exception. --- Additionally, you can adapt that code so that the user is asked for the password or otherwise made to choose a different file until the statement passes without triggering exceptions. – CosmicGiant Aug 15 '12 at 15:57