In Office – Applications – Started!, Ralf Stolzenburg posted sample VBA code for instantiating several Office applications. I've written about this subject as well, in Easy Application.Object References.
I like my code better, because it avoids the global Object variables present in Ralf's code. (Although as we'll see later, at least one global Boolean variable may be required.) I'd prefer to have one routine create (and return) the object, then pass it to another routine that does something else. It's all part of the encapsulation and loose coupling attitude I've mentioned elsewhere.
Follow Me