tags:

views:

286

answers:

2

Hello,

I need to remove the password protection from an uploaded excel file. I have been doing this directly with the Excel assemblies (ASP.NET/C#) and then I tried with the ooxmlcrypto, both worked, but the problem is that I can not deploy either of those solution because of the dependencies.

I mean, my sysadmin does not want us installing Excel on the server and, as I have been searching for some alternatives, I can not find one.

My question is: is there a way to put the necessary dlls in the server without installing Excel or the Office suite?

I found this: Office 2007 Primary Interop Assemblies redistributable package but still, it requires a Microsoft Office Product.

Any ideas?

+1  A: 

You're looking at the problem the wrong way. If you can't use Excel, then don't process Excel. Trying to reverse-engineer Excel is not the road you want to go down. Get your clients to use another format. For security, use an open encryption standard such as zipping the files. Also, spreadsheets are a terrible format for processing, because users will always find new ways of mangling the layout. They will submit dates as strings, or add a new column, etc. You will be forever making small changes to idiot-proof your code. Insist on something unambiguous, like csv

Greg
Very good answer, getting users to submit data in Excel is a nightmare. Where I work we employ a data import process for our core product, which allows users to edit data in Excel, but then we get them to set a range and export it as a DBF file. Still not pretty, but it allows us to kind of enforce some structure to the data.
mdm
-1: If you have to support managing Excel files on the server because the customer needs that, then that's how it is. Don't tell your customer "you have to change your requirement because I don't have a straightforward solution". There are many reasons why people want/need to work with Excel, and it's not simple at all just to get rid of it.
chiccodoro
+1  A: 

You can use third party component to remove the Excel password.

For example: SmartXLS for .Net can read/write Excel97-2003 xls file and Excel2007 xlsx file with the password to encrypt/decrypt it.

liya