Office 2011 for Mac Dictionary replacement

  • HI



    I've Created a class to mimic the dictionary object for those of us who have windows in work and a mac at home!
    (You'll need to download the class file if you want the default property as item. Simply rename to remove the .txt and import into your vba project)


    Please read the notes:


    Thanks



  • Re: Office 2011 for Mac Dictionary replacement


    You can also use something like this hashtable (you could rename as a dictionary) class:

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

  • It's been a long time since I've even looked at this, but it became apparent that with very large collections performance was terrible so I have amended how this works. It actually looks a bit horrible but it's much quicker than the old implementation and now also has 1:1 parity with the windows dictionary object (including errors). As a bonus it also just uses the built-in dictionary object if the class is used in windows.
    Anyway, I'm not going to bother pasting the code as it requires you import the .cls file to make sure you get ".item" as the default property (Simply rename to remove the .txt and import into your vba project).


    I've also included a code below for an accompanying sub that I find useful to use along side if you are using late binding in your project.




  • Apologies, inadvertently introduced an error in the re-write that was thrown if you tried to use dates or objects as keys (which is possible with the built-in Dictionary). Minor tweak to how I'm hashing keys to fix it. (Use instructions above to import into your project)