Extract VBA From XLSM and XLAM Excel Workbooks

I created a C# .NET class to extract VBA from XLSM and XLAM Excel workbooks – even if password protected. I used Mirosoft’s Open XML SDK 2.5 to read a workbook’s VbaProjectPart stream. From the bin stream I extract the VBA source code using Structured Storage API’s.

Microsoft’s Office VBA File Format Structure Reference

I have even been able to retrieve VBA from corrupted workbooks that won’t even open in Excel. See the class in action here.

Extract VBA From XLSM and XLAM Excel Workbooks
Extract VBA Source Code From XLSM and XLAM Excel Workbooks

2 thoughts on “Extract VBA From XLSM and XLAM Excel Workbooks”

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.