Question

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.

Thanks

Was it helpful?

Solution

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.

OTHER TIPS

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 = ""
xlWB.Save()
xlWB.Close(False)
xlApp.Quit()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top