A package manager and build tool for VBA.
- Download and install the latest release for your platform (Windows or Mac)
- 🚀 You're ready to go! Open a new command-line session (cmd / terminal) and try
vba-blocks help
Create a new folder with a blank/generated vba-blocks project inside
# Create a folder "project-name" with a blank xlsm project
> vba-blocks new project-name.xlsm
# (equivalent to above)
> vba-blocks new project-name --target xlsm
# Create a folder "from-existing" with a project from an existing workbook
> vba-blocks new from-existing --from existing.xlsm
# Create a blank package for sharing as a library between projects
> vba-blocks new json-converter --package
Create a blank/generated vba-blocks project in the current folder
# Create a blank xlsm project with current folder's name
> vba-blocks init --target xlsm
# Create a project from an existing workbook
> vba-blocks init --from existing.xlsm
# Create a blank package
> vba-blocks init --package
Build an Excel workbook from the project's source. The built file is located in the build/
folder and if a previously built file is found it is moved to /.backup
to protect against losing any previously saved work.
# Build a project
> vba-blocks build
# Build and open a project for editing
> vba-blocks build --open
# Build a package using a blank target
> vba-blocks build --target xlsm
Once you've completed your edits and are ready to commit your changes, export your project with vba-blocks export
.
# Export a project
> vba-blocks export
# Export a previously built package
> vba-blocks export --target xlsm
vba-blocks run
is a useful utility function for running a public macro in the given workbook and if it returns a string value, outputing it to the console.
' File: build/example.xlsm
' Module: Tests
Public Function RunTests(Value As Variant) As String
' (currently, a single Variant input argument is required)
RunTests = "Howdy!"
End Function
> vba-blocks run build/example.xlsm Tests.RunTests
Howdy!
git clone
this repo- Install node v8.11.4 or later
- Install yarn v1.9.4 or later
- Install node-gyp dependencies for Mac or Windows
- Run
yarn
- Run
yarn build:win
(Windows) oryarn build:mac
(Mac)