Sure. The first one is called "early binding".
Is that the only difference? I do actually know about early vs. late
binding, but when I was playing with it earlier, IntelliSense didn't work
and I was getting different error messages depending on which method I used,
so I thought I was addressing two different object libraries. When I try it
now, though, setting up two variables, one of each kind, in a test routine,
IntelliSense does work (for the early-bound one). The error messages, when I
intentionally munch the regexp string, are different in text but both throw
the same 5020 error. I'm not certain now if that was the case before, just
that the text was different, but it probably was.
I've run into differences before, where early and late binding acted
differently when automating Word and Access, and with a third-party library
called AutoIT. Sometimes one method simply doesn't work and the other does,
but maybe I'm just doing something wrong.
The later is called "late binding". You don't need a
reference. The type is resolved at runtime and it
match different versions.
I swap this Access mdb between several machines, some running 2003, some
2007. I use automation of a Word template from Access, automation of Access
back from the Word template and early binding in both. When I compile on a
2003 machine and move to a 2007 machine, everything works, but when I
compile on a 2007 machine, then carry it back to a 2003 machine, the Word
reference is broken (missing) and I have to reset it. This is an app that
will be going into service and will be moved between machines in the same
way by users. If I used late binding (correctly), would that solve this
issue permanently? The speed difference is not significant and if it will
fix this problem, I'll live without IntelliSense, or design with early
binding, then switch to late for the final user's version.
Pete