I have a local machine (i.e. Development) and a virtual machine (i.e. Production). Between the 2, I develop and maintain a few automated reports using Access, Excel, and Lotus Notes.
Recently, I was tasked with a new report that was very similar to an existing one. So, I just copied the appropriate Access file from Production back to Development to rework it. And it failed. With some trial & error, I’ve narrowed it down to this snippet:
Option Compare Database
Option Explicit
Global NtSession As lotus.NotesSession
Sub Main()
Set NtSession = CreateObject("Notes.NotesSession")
...
End Sub
Again, this code works fine in Production, but it now breaks when I try to run in on my Development (I get a “Type Mismatch” error on the CreateObject). The easiest way around this is to just to develop my report in Production, but that kind of defeats the purpose, not to mention the oddity that it used to work on my local machine in the first place and now it doesn’t. So, why is this throwing an error on my local machine (i.e. Dev), but not in the virtual (i.e. Production)?
Based on Ken’s response, I suggest you decide whether you want late or early binding.
or
I just don’t see the value of mixing the two, as in