Scripting.Dictionary仍然常用于VBA?

时间:2021-11-17 14:51:56

I had to cobble together some code in Excel/VBA and vaguely remember we used to add a reference to Microsoft Scripting Runtime to use Dictionary. Now in the days of Office 2010, is that still the preferred way of getting access to a Dictionary like structure or have things moved on?

我不得不在Excel / VBA中拼凑一些代码并且依稀记得我们曾经使用添加对Microsoft Scripting Runtime的引用来使用Dictionary。现在,在Office 2010的时代,这仍然是获取类似结构的字体或移动内容的首选方式吗?

2 个解决方案

#1


4  

Dictionaries are still used the same old way in Excel VBA -- Read more here Does VBA have Dictionary Structure?

在Excel VBA中,字典仍然使用相同的旧方法 - 在这里阅读更多VBA是否具有字典结构?

But there is an alternative to dictionary objects, using Collections More about that here: Using Dictionary Object in Excel VBA

但是有一个替代字典对象,使用集合更多关于它:在Excel VBA中使用字典对象

#2


0  

Be aware! Microsoft Scripting Runtime does not work on Mac. There is a workaround though. Get this https://github.com/VBA-tools/VBA-Dictionary and import Dictionary.cls into your VBA project. This will create a Dictionary class that will be used instead of the one in Microsoft Scripting Runtime

意识到! Microsoft Scripting Runtime无法在Mac上运行。但有一个解决方法。获取此https://github.com/VBA-tools/VBA-Dictionary并将Dictionary.cls导入您的VBA项目。这将创建一个Dictionary类,而不是Microsoft Scripting Runtime中的类

#1


4  

Dictionaries are still used the same old way in Excel VBA -- Read more here Does VBA have Dictionary Structure?

在Excel VBA中,字典仍然使用相同的旧方法 - 在这里阅读更多VBA是否具有字典结构?

But there is an alternative to dictionary objects, using Collections More about that here: Using Dictionary Object in Excel VBA

但是有一个替代字典对象,使用集合更多关于它:在Excel VBA中使用字典对象

#2


0  

Be aware! Microsoft Scripting Runtime does not work on Mac. There is a workaround though. Get this https://github.com/VBA-tools/VBA-Dictionary and import Dictionary.cls into your VBA project. This will create a Dictionary class that will be used instead of the one in Microsoft Scripting Runtime

意识到! Microsoft Scripting Runtime无法在Mac上运行。但有一个解决方法。获取此https://github.com/VBA-tools/VBA-Dictionary并将Dictionary.cls导入您的VBA项目。这将创建一个Dictionary类,而不是Microsoft Scripting Runtime中的类