Quite often you need to add some reference to be able to get some code to compile. This is because the code is referencing some external object that the Excel VBA does not know about. Normally you would add these references through a dialogue, like the example below.
If you know the details about a reference you can actually add them programatically. This is useful if you are sharing code that has some reference dependency and is the method that will be used in How to update modules automatically in VBA.
Here's how to get the GUID, and major and minor versions. Now - next you'll want to know How to add references by guid
For more tips like this see Get Started Snippets.
In the meantime why not join our forum, follow the blog or follow me on twitter to ensure you get updates when they are available.
You want to learn Google Apps Script?
Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, available All formats are available now from O'Reilly,Amazon and all good bookshops. You can also read a preview on O'Reilly.
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Get Started Snippets >