X-VBA

Usage

To use XMinifier and XCombiner, use the text boxes and buttons below. The gray box contains the combined and minified code, while the white boxes are where you can input VBA code.

Version 1.0.0


XMinifier

XMinfier is a tool used to minify VBA code by removing excess syntax features (such as excess whitespace and comments) in order to reduce the size of the code. This can be useful when including VBA code into Excel, Word, and PowerPoint files, as it can reduce the total file size by reducing the amount of space that the VBA code occupies. In some cases the reduction in VBA code size can be substantial. In one case I was able to reduce the size of my VBA code from ~150KB down to ~50KB, saving a significant amount of space in the total file.

XCombiner

In addition to XMinifier, XCombiner can be used to combine all your VBA code modules into a single file, removing excess Attribute names, and combining Option settings found in mutliple modules. This can be useful when sending distributing your source code, as the entire source code can be imported in a single file instead of multiple files. However, there are limitations to combining VBA source code files:

Source Code

XCombiner and XMinifier are open source software, and the source code for each program can at the official github pages:

Where does my code go?

XMinifier and XCombiner are written in pure JavaScript, which means they can be shipped and run in the web browser. Both programs are embedded in this web page and are run purely locally. No code is shipped to a server elsewhere, all of your code remains purely on your machine. In fact, the only web request ever used is the one to fetch this webpage. No external JavaScript files or libraries are used on this web page, nor are any images or CSS files. As a result, this single page can be saved and run offline whenever you need to combine or minify your VBA code. And since it runs offline, you can rest assure that your code remains purely with you and isn't ever sent to a server.

License

The MIT License (MIT)

Copyright © 2020 Anthony Mancini

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.