6

Repro:

  • Start Excel and open VBE ALT+F11.

  • Find Tools and click References.

  • Scroll down til you find Microsoft Scripting Runtime and tick it.

  • Save the file as Addin.xlam in the default location which should be something like:

    C:\Users\username\AppData\Roaming\Microsoft\AddIns

  • Close this Excel instance

  • Start a new instance and open VBE (you should now see the Addin.xlam as the second VBA Project available for the workbook. If you don't open the Developer tab then add-ins and tick the box next to the name to turn it on - save, close, open a new Excel instance)

  • Add a new standard Module

  • Open References and you should see only 4 ticked (default)

  • Scroll down and try to find Microsoft Scripting Dictionary - it ain't there!?

So, this basically means you can't add the reference to the new VBA Project (Book1) because your *.xlam is already using it

but

you can't cross-use the Scripting library because trying

Dim d as Dictionary

in that newly created Module1 fails as it doesn't recognise Dictionary object....

Is this somehow a known bug I have never realised or have I just completely overlooked something? Any workarounds?

Community
  • 1
  • 1
  • 2
    I am unable to replicate your problem. I followed your instructions and I can add that reference to a new module in a new workbook just fine. Did you look at the top of the list? If you're using a reference in another open workbook or add-in it move up near the top of the list. – Mr. Mascaro Oct 16 '14 at 15:48
  • 1
    Even if it's not listed you should be able to just browse to scrrun.dll – Rory Oct 16 '14 at 15:53
  • @jbarker2160 gotcha! I was looking at only active references. I have about 30 other things on my list that show up before the `Microsoft Scripting Runtime` and I have totally missed it –  Oct 16 '14 at 16:51

1 Answers1

6

The IDE keeps recently used references near the top of the list. Don't scroll down. It's right at the top. I'll admit. This threw me for a loop for a second too.

VBAProject References

RubberDuck
  • 11,933
  • 4
  • 50
  • 95