In a previous post I covered a way of automatically including and inserting VBA code in Excel from gists. You would normally use this if you wanted to include a bunch of functions and classes and excel references with dependencies on each other in some workbook. However, you can easily use it to just pull in a simple class or function, or even to set up references automatically. The main thing though, is that you can get updates directly from gist as and when required.
Using the cStringChunker class as an example, lets go through the steps needed to make this happen. First create an empty workbook (.xlsm) to play around with. You can repeat later in a real workbook if you want.
You need some code that will manage the initial load and future updates. You only need to do this once per workbook. You can get this here. Create a module and paste in the code – I usually name the module gistThat_, but its not important what you call it. Once you have this, you can just leave it in the workbook to use again later.
Allow access to the IDE
The bootstrap works by retrieving code from a Gist, then writing that code in the workbook. You need to allow it to be able to do that in the macro settings Excel Trust Center
Run the update
Either in the immediate window, or in a procedure you create, run this
gtDoit “5152181”, True
Set access to the IDE back off
A more complicated example
Your own code distribution
For more stuff like this, visit the Excel liberation site.