My hackweek project was influenced by a confluence of issues i) For some time now we have known that the VBA project structure has some influence on OLE controls strored in a microsoft document. When exporting documents with such controls we can run into some problems. The type of problems run from the controls are not usable to some worrying & annoying nag dialogs (warning the controls may not be activated or some such thing ). Typically this isn't an issue when roundtripping ( e.g. reading in a microsoft document and saving it back again to the microsoft format ) this problem is normally one seen when exporting a native Libreoffice format to a microsoft format. In some cases like Powerpoint export we cannot export controls at all. Now although out binary filters do read the VBA project, a fair amount of data is skipped, ignored or not read at all. ii) There are some binary dumping tools for libreoffice that dump content of various document formats but we don't have anything that dumps the VBA related records iii) libgsf used at one time in it's test suite have a program that extracted VBA modules from microsoft documents however it only worked for Excel, libgsf isn't exactly universally available. In the absence of the vba extractor that used to be in libgsf it would be nice to be able to access ( as text ) the Module content without having to fire-up Libreoffice iv) I wanted to learn python ( in a previous Hackweek about 2 years ago I had my first exposure to python programming, I have not used python since. ) So hears what I did a) I implemented the VBA compression & decompression algorithms, the need for the decompression algorithm is clear, alot of the streams in the VBA container (including the code Modules) are compressed. But.. being able to compress the streams will also hopefully be useful, it should allow for a project structure to be manually constructed for insertion into a document for testing by Excel/Word etc. b) Wrote some simple compress.py & decompress.py cmd line tools to allow stand alone streams to be compressed/decompressed c) Wrote a vbadump.py tool, this tool searches for and locates the VBA project in a microsoft compound OLE document. The 'dir' stream is the key information stream in a VBA project, it is stored using the VBA compression algorithm mentioned above, currently the dump tool parses and prints all the records contained in that stream, information from the dir stream is also used to locate and dump the Module streams. Currently the tool does not dump the any information from the Userform streams. d) Updated the old hackweek 'oletool.py' project, fixed some bugs and split out some functionality needed by the vbadump tool e) created a new module vbahelper.py used by vbadump.py, decompress.py & compress.py f) I had started in the previously mentioned Hackweek a tool to inspect/modify the content of OLE compound documents ( the format used for Word, Excel etc. binary docs ) in a manner not unlike zip. I failed in that attempt, the branch is still there, in the remaining Hackweek time I tried to get to grips with that, unfortunately only managed to fix a minor bug ( http://cgit.freedesktop.org/libreoffice/contrib/mso-dumper/commit/?h=feature/writeable-oletool&id=944df93d70bd0b60d9c299cd2f3ca2d45b5f7658 ) bits & pieces git log http://cgit.freedesktop.org/libreoffice/contrib/mso-dumper/log/?qt=range&q=57508ed1fa44d39354ac9251596848edbfdaf9ff..7c8934719fcb31d319d68ab477d37464b02f49af files vbadump.py http://cgit.freedesktop.org/libreoffice/contrib/mso-dumper/tree/vbadump.py compress.py http://cgit.freedesktop.org/libreoffice/contrib/mso-dumper/tree/compress.py decompress.py http://cgit.freedesktop.org/libreoffice/contrib/mso-dumper/tree/decompress.py vbahelper.py http://cgit.freedesktop.org/libreoffice/contrib/mso-dumper/tree/msodumper/vbahelper.py Source file http://users.freedesktop.org/~noelp/HackWeek2013/Suse-puzzler.xls sample output of ./vbadump.py SusePuzzler.xls http://users.freedesktop.org/~noelp/HackWeek2013/Suse-puzzler-dump.txt Sample Module http://users.freedesktop.org/~noelp/HackWeek2013/Module1 Sample use of compress/decompress cat Module1 > Module1.deflate http://users.freedesktop.org/~noelp/HackWeek2013/Module1.deflate cat Module1 | ./compress.py | ./decompress.py > Module1.roundtrip diff Module Module.rountrip