Take the 2-minute tour ×

We receive Excel workbook files every day which are password protected with the same password. We know this password. Is there a utility or method to remove password protection on these workbook files without invoking Excel.exe or the Excel object. Our goal is to take Excel out of the process and utilize SpreadsheetGear in VB.net. However, SpreadsheetGear can only unprotect worksheets not workbooks.


share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Are they XLS or XLSX files?

for XLSX apparently you can use the RMS SDK to work with encrypted XLSX storage format. http://msdn.microsoft.com/en-us/library/aa767782(VS.85).aspx

Looking at it though its just a spec with almost no code samples so best of luck with that. once you have access to the underlying xml you can use standard xml namespace from .net or java to work with the file.

2003 (XLS) format, unless you use a propietrary 3rd party vendor solution that supports programmatic access (not aware of any specific products) you are out of luck.

share|improve this answer
add comment

You just need to set the Password property of the workbook to an empty string. In Python:

from win32com.client import DispatchEx
xlApp = DispatchEx("Excel.Application")
xlApp.Workbooks.Open (mySpreadsheet, Password=myPassword, WriteResPassword=myPassword)
xlWB = xlApp.Workbooks[0]
xlWB.Password = ""
share|improve this answer
Greg, Thanks for the response. Unfortunately this misses the mark since it will still launch Excel.exe. I need some way to work with the file that doesn't involve the Excel object or exe. –  cookes Aug 11 '09 at 20:26
Um, if you don't want to run Excel on a server, you may still want to reconsider. The Excel API has a few options for instantiation. One is to always use a new instance; this keeps multiple processes from stepping on each others' toes. Memory usage is maybe 20MB each - for the whole 1 second that it will be running. –  Greg Aug 11 '09 at 20:27
I agree, but we're already running Excel on the server and my boss would like to get it out of the process. –  cookes Aug 11 '09 at 20:49
Waitaminnit here... you receive encrypted Excel spreadsheets and yet youur goal is to process something other than Excel... Dude, your solution is to tell your client to send you something other than Excel! Really, Excel is a great solution for some problems, but it sounds like you should be demanding something else like CSV... –  Greg Aug 12 '09 at 2:53
add comment

Your Answer


