Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading password protected Excel spreadsheet

 
Denis Mir
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have an excel spreadsheet that was designed to be a form where you can plug-in some
values and it will calculate costs based on the formula, it takes about 30 different parameters.
I can open this form, enter values and get a result without entering password (both manually
and in Java). I don't have access to the formula.

At the moment I'm using e-Spreadsheet from Actuate. http://www.actuate.com/products/e-spreadsheet/

But the problem is that it's very slow. Opening the document takes 5.8 seconds and about
2.6 seconds to read result from the bottom of the form. This is a 3.6 meg file, maybe that's
the reason?

I tried http://jexcelapi.sourceforge.net/ and http://poi.apache.org/. Both of these libraries
cannot handle password protected Excels. I wanted to try Weblogic JCom but I'm not sure
which DLL I need to access and how to use it (I used JCom before to access another DLL.)
I'm going to try OpenXLS http://sourceforge.net/projects/openxls/ next.

Do you guys know how to do this? How can I access this form without needing password?

Thank you,
Denis
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

While I'm not sure either way, there are indications that jExcelApi can be used to unlock Excel spreadsheets without having the password. That may be worth a try; let us know how you make out if you do.
 
Sergio Hernández
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i'll be very glad if someone can give us a solution to this problem.
I have the password of the excel document, but dont know how to open it.

Thanks a lot,
Sergio.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sergio, did you read (and act on) my previous post?
 
Sergio Hernández
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, i read it and try,but dont works.
My excel document is sheet protected and book protected.

i've got the same exception (jxl.read.biff.PasswordException: The workbook is password protected) in the first line: Workbook workbook = Workbook.getWorkbook(new File("/path/to/protected.xls"));

Sergio.
 
Denis Mir
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Thank you for your replies. My problem was solved by testing my code on our server.
On my development machine my code would take about 7 seconds. On server it
is 0.7 seconds. So I don't have a problem anymore (can somebody recommend
good profiling tool? I want to figure out what exactly is going on.)

For the guys that have problem accessing password protected Excel sheets.
With e-Spreadsheet from Actuate. http://www.actuate.com/products/e-spreadsheet/
I don't have to enter the password. I can open the spreadsheet that I'm working with,
enter values and get results just by opening it in Excel. I'm not sure how e-Spreadsheet does
it but I can set cells that I need for calculation and I can read the results from result cells.

Denis
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic