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.
I have even been able to retrieve VBA from corrupted workbooks that won’t even open in Excel. See the class in action here.