Skip to content

Macro enabled workbooks

foglcz edited this page Apr 23, 2013 · 13 revisions

Going into macro preparation within Excel itself is kinda out of the scope of this documentation. However, our usecase was specifically with the Code128 barcodes.

If you clicked above link, seriously, don't look at the design. It contains gold!

Once you have your macro workbook, you need to save it under different extension - the .xlsm . This differentiates macro excels from the 'standard excels' and allows macros to be even run. Otherwise, the structure is pretty much the same - and from Engine standpoint, it's even easier.

All you need to do is unzip the .xlsm file as usual. Then, you need to locate the xl/vbaProject.bin file, save it under your own name and tell this name to the engine:

<xsl:with-param name="vbas"><vba>YourWorkbook_Vba.bin</vba></xsl:with-param>

VBA macros are shared across entire document, therefore there will usually be only one .bin file. However, as we could not confirm or deny this, the engine syntax supports multiple files.

Don't use more than one, it's untested!

Navigation

  1. Preparing excel files
  2. Preparing the first output
  3. Putting plain data into excel sheet
  4. Appending images
  5. Creating multiple worksheets
  6. Printer settings
  7. Macro-enabled workbooks
  8. Under the hood
  9. Engine parameters documentation
  10. Best practice for writing Excel XML
  11. Authors, license, contributing