On Mon, 12 Sep 2011, Simmons, Tom (GE Oil & Gas, VG) wrote:
I've now got...

        System.out.println(new Date());
        NPOIFSFileSystem npoiFS = new NPOIFSFileSystem( new File("d:\\big n 
p.xls"));
        System.out.println(new Date());
        HSSFWorkbook wb = new HSSFWorkbook(npoiFS.getRoot(), true);
        System.out.println(new Date());
        Boolean check = wb. isWriteProtected();
        System.out.println(check);

You could try with the event usermodel, and bail out once you hit a point where it has worked.

I'm also no longer sure I'm using the correct test (isWiteProtected). All I am looking for is to check that the workbook hasn't had a password added that prevents it being loaded/opened.

I'd suggest you create two files, one which isn't protected and one that is (in the way you want to check for). Try with them and use that to verify!

Nick

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

Reply via email to