Not sure if this helps, but I know of a perl hacker who uses perl to generate VBA-Code. How complex this task is in his case - I don't know (could be a simple template-like mechanism or some kind of transcoding job you would need). PM me if you'd like contact.