2

Or compile VB file to .exe in Perl?

I am using the unzip command to extract the VBA-bin from the sample XLSM excel file.

unzip -j xl/sample.xlsm xl/vbaProject.bin

I have the same macro code in the sample.vb file in a git directory. I am generating the XLSM files using Perl script and adding vbaProject.bin in those generated files using

$workbook->add_vba_project( '/home/pathtosharedtemplatefolder/vbaProject.bin' );

I am planning to update the sample.vb file in "pathtosharedtemplatefolder" directory. So I can compile the sample.vba file locally to generate the bin file for the formatting of the sheet rather than using the project.bin file itself. This way I also can keep track of the sample.vb files update with git diff for debug purposes.

Or

what is Linux command/PERL code to compile the VBA to project-bin?

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
himmat
  • 159
  • 5
  • 1
    "what is linux command/perl code" ...you can't do that on Windows, let alone on Linux. There's no command-line compiler for VBA, its **hosted** nature is intrinsic. The .bin content is written by the `IStorage` implementation of the VBA host application (here Excel), and the format is AFAIK not documented since it's host-specific and proprietary. Consider however, what the worst-case utilization could be of a feature that allows arbitrary code to bypass the host storage mechanism and stitch together a macro-enabled document - could explain the roadblock ;-) – Mathieu Guindon May 11 '20 at 18:26
  • If you have Office 2000 Developer Edition (x86), then you can compile a (32-bit) .dll out of your VBA project - that hasn't been a possibility for a long time though. – Mathieu Guindon May 11 '20 at 18:27

0 Answers0