VBA Excel宏无法创建SortedList

问题描述 投票:1回答:1

我有一个在Excel中运行并使用SortedList的VBA宏。在大多数计算机上,它运行良好。上一行,>

Dim myEvents As New SortedList

导致myEvents的值为Nothing。行

myEvents = createobject("system.collections.sortedlist")

导致“自动化错误”。 mscorlib.dll在我的引用中,并且已选中。

任何人都知道发生了什么事吗?由于宏可以在其他计算机上使用,因此我认为这一定是系统设置问题,但我不知道它可能是什么。

OS Name Microsoft Windows 10 Pro
Version 10.0.18362 Build 18362
System Model    Surface Laptop
System Type x64-based PC

我有一个在Excel中运行并使用SortedList的VBA宏。在大多数计算机上,它运行良好。一方面,行Dim myEvents As New SortedList导致myEvents的值为Nothing。该行...

excel vba com-interop
1个回答
0
投票
Dim myEvents As New SortedList
© www.soinside.com 2019 - 2024. All rights reserved.