TSTVBA is a Node.js CLI tool (v1.0.1) that transpiles TypeScript into VBA modules (.bas and .cls) for Excel/Office automation. It requires Node >=18.0.0 and TypeScript >=5.0.0 as peer dependencies. Key features include class-to-class module mirroring, try/catch-to-On Error mapping, for...of iteration bridging, configurable namespace prefixing, and bundle output with manifest. Unlike generic code generators, it produces real VBA classes, source maps, and integrates directly with tsconfig.json via tstvbaOptions. Maintenance is active on GitHub.
npm install typescript-to-vbaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize a project, validate config, and transpile a TypeScript file to VBA.
Update Node to version >=18.0.0
Install TypeScript >=5.0.0 as a devDependency
Use npx tstvba instead of global install
Use VBE -> File -> Import File... to import .cls files
Upgrade TypeScript to >=5.0.0
Run 'npx tstvba --init' to generate tsconfig.tstvba.json
Use 'npx tstvba' instead of global binary