If everyone runs consistent suite of apps then things are relatively straightforward for early binding, eg:
and if desired run a remove before closing the file (could cause issues if library being used in other files in same application instance)
Both of the above residing in ThisWorkbook object.
In a separate module, the below code:
(In 2007 MS Internet Controls is seemingly not listed by default in References)
You didn't specify what errors you were getting previously... if you try and add the library and it's referenced already you would generate an error, the above has a handler in place... obviously the handler means that if it's not added because it's not available then your other code will still a generate an error given the objects used can't be found (as library not referenced)
re: the other library-less approach ... this is late binding... you will find lots of articles on line about the method, far superior to anything I could put together... in short late binding can be a little slower but more importantly harder to code as you don't have intellisense when you put it together, the advantage is of course you don't need to reference the library... early binding with libraries gets more complex if you run multiple versions as libraries are not backwards compatible... ie someone using say Word 12.0 library who forwards the file to someone on 2003 (11.0) will generate an error.
I should add that elements of the above code are based off code posted by Leith Ross here previously...
Bookmarks