2

I have a workbook with plenty of VBA on it, many using the Dictionary object. The problem is that Excel for Mac OS X doesn't seem to have the "Microsoft Scripting Runtime" library, thus, no Dictionary object.

How could I solve this issue? Is there any alternative library? Any alternative Dictionary class?

Community
  • 1
  • 1
Caio Cunha
  • 23,326
  • 6
  • 78
  • 74
  • Check the answers at [VBA (Excel) Dictionary on Mac?](http://stackoverflow.com/questions/19869266/vba-excel-dictionary-on-mac) for a dictionary replacement – Frobbit Jun 26 '14 at 19:01

1 Answers1

3

I used Collection instead of Dictionary, and my problem is now solved now is now partially solved, as Collection seems to be native.

UPDATE: The problem is that Dictionary has some more features, like iterating through the keys. But I could work around this in my specific case.

psmears
  • 26,070
  • 4
  • 40
  • 48
Caio Cunha
  • 23,326
  • 6
  • 78
  • 74
  • I am trying to make a workbook that will work on Mac and PC the same, on OS X what did you select to replace Microsoft Scripting RunTime? I only ask because I need it on the PC and as you say it doesn't exist on the Mac... I have Office 2011, I was hoping it would by now. – Matt Ridge Jun 01 '12 at 18:34
  • Hi, Matt. As I said, I ended up using Collection that is native on Mac OS X, but I don't believe it is on Excel. At the end, I had to rewrite the code for there was another issues. Maybe the better you do is to abstract most of the logic to separate modules and replace then on each OS. – Caio Cunha Jul 02 '12 at 13:23