A utility to extract a vba project from an excel 2007+ xlsm file.
This utility is used to extract the \s-1VBA\s0 project binary from an Excel 2007+ xlsm file. The \s-1VBA\s0 project can then be added to an Excel::Writer::XLSX file to enable it to have macros.
An \*(C`xlsm\*(C' file is a version of an Excel \*(C`xlsx\*(C' file that contains an additional \s-1VBA\s0 project binary file. The \*(C`xlsm\*(C' file format is a collection of mainly \s-1XML\s0 files in a \s-1ZIP\s0 container.
The extracted \s-1VBA\s0 project is an \s-1OLE\s0 Compound Document in binary format. It is named \*(C`vbaProject.bin\*(C' and is generally located in the \*(C`xl\*(C' directory of the \*(C`xlsm\*(C' file.
See the \*(C`add_vba_project()\*(C' section of the Excel::Writer::XLSX documentation for more details.
Note: you can also extract the \s-1VBA\s0 project from an \*(C`xlsm\*(C' file using the standard Linux \*(C`unzip\*(C' command:
unzip -j macro01.xlsm xl/vbaProject.bin
On Windows you can use any suitable Unzip application.
$ extract_vba file.xlsm Extracted 'vbaProject.bin' successfully
$ extract_vba -h # For help.
Print the help documentation.
John McNamara [email protected]
Version 0.01.
(c) \s-1MMXII\s0, John McNamara.
All Rights Reserved. This program is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.