Build 4.0.0.15 of xlsgen adds support for decrypting password-protected XLS files. It's been a while since we had support for XLSX files, and we are now introducing support for XLS files which means xlsgen can decrypt any Excel file.
How it works is, as expected, to simply pass the open password to the engine before trying to open a spreadsheet. For this there is the engine.Workbooks.OpenPassword property that takes a string. It does not matter if you set an open password even though the spreadsheet isn't encrypted. Also, xlsgen returns the error code 0x80072001 (which becomes an exception depending on your programming language) if the password is incorrect, or if no password is passed to open an encrypted spreadsheet.
The mechanism is the same for XLS and XLSX files (and their variants, XLSB, XLM, ...). Internally it is a different story. We are talking an entirely different story for "old" Excel files, basically MD5 for hashing, and XOR/RC4 for encrypting, and for "new" files, basically SHA-x for hashing and AES for encrypting.
engine->Workbooks->OpenPassword = L"abcd";
xlsgen::IXlsWorkbookPtr wbk = engine->Open( L"passwordprotected.xls", L"");
wbk->Close();