I would like to use early binding for dictionary objects if the Microsoft Scripting Runtime library is referenced; however, if my macro runs on a machine that did not reference the library, I would like to use late-binding.

For example, I would like to do something like this:
If [some expression to det. if a library is referenced] Then
    Dim MyDictionary As Dictionary
    Set MyDictionary = New Dictionary
Else
    Dim MyDictionary As Object
    Set MyDictionary = CreateObject("Scripting.Dictionary") 
End If
I know that will not work because the declarations are made before the If-Else statement runs, but is there any way to accomplish what I want to do (conceptually) above?

I think it would make solving Forum member's solutions easier because it would allow me to take advantage of the intellesense list of a dictionary object without changing the code for solutions I post in the forum. And I'd learn more about VBA if I could determine which libraries are referenced in VBA.