The code attached here demonstrates how to use C# to open password protected
Excel Files/Workbooks and Worksheets. This is a fairly crude console
application but it seems to work and is a good starting point.
It uses two methods of generating lists of 'Brute force' passwords.
To unprotect a workbook, sheet, cell range is fairly quick. To open a file can take days/years/millenia.
This is a development tool - if you simply need a quick clean way to unlock a
workbook/worksheet please use the ready-to-go Excel Password Cracker Click here.
Sample spreadsheet with password protected sheets and workbook
THIS IS NOT FULLY TESTED CODE - USER BEWARE. IT IS NOT A COMMERCIAL TOOL. PLEASE SAVE A COPY OF ANY WORKBOOKS BEFORE YOU TRY TO CRACK THEM.
I will paste the code below but in the mean time I have attached it in two CS files above.
I will get round to explaining it one day but feel free to load it up, make
sure you reference the file you want to crack ( i have attached on with lock
worksheets to play with).
There are two files required - Program.cs and PXList.cs. PXList is a list
of the password generation routines.
If it crashes it sometimes leave an instance of Excel Open - so Ctrl-Alt-Delete
and find the 'EXCEL' process to stop it.
Very little checking is done. The code isn't perfect. Very much a
Nothing much, just for fun
Excel, cracker, C#, crack, hack, worksheet, spreadsheet, code, password, brute
force, attack,97, 2010, 2007, locked, cells, sheet, workbook, .NET., unhide,
This was developed for my own benefit and for fun. It is not a commercial
product and have not been thoroughly tested etc.