视觉基础错误| Office 2016 for Mac |编译错误:未定义用户定义的类型 [英] Visual Basis Error | Office 2016 for Mac | Compile Error: User-defined type not defined
问题描述
Hello社区;
Hello community;
我有一个 "编译错误:用户定义的类型未定义" ;使用带有来自第三方供应商的宏的电子表格。在下面找到发生错误的Visual Basic编辑器部分:
I have a "Compile Error: User-Defined type not defined" upon using an spreadsheet with Macros from a third party vendor. Find below the portion of Visual Basic Editor where the Error occurs:
'为所有默认财务信息创建字典
'Creating a dictionary for all the default financial ctegory
  Dim defaultFinCat 作为
新 词典
Dim defaultFinCat As New Dictionary
  rowCounter = 2
rowCounter = 2
  对于 每个 acntType In 工作表("LOV")。范围(&"AccountType")。Cells
For Each acntType In Worksheets("LOV's").Range("AccountType").Cells
&NBSP; &NBSP; &NBSP; &NBSP; If Sheets("LOV's")。Cells(rowCounter,15)<> ""
然后
If Sheets("LOV's").Cells(rowCounter, 15) <> "" Then
&NBSP; &NBSP; &NBSP; &NBSP; &NBSP; defaultFinCat.Add acntType& " /" ;, Sheets(" LOV's")。Cells(rowCounter,15)
defaultFinCat.Add acntType & "/", Sheets("LOV's").Cells(rowCounter, 15)
&NBSP; &NBSP; &NBSP; 结束 如果
End If
&NBSP; &NBSP; &NBSP; rowCounter = rowCounter + 1
rowCounter = rowCounter + 1
&NBSP; 下一步
Next
您的信息,Windows版Office版本中不会出现此问题。这只适用于Mac。 能告诉我如何解决这个问题吗?如果你需要整个excel进行测试,请告诉我。
For your information, the issue is not occurring in the Office version for Windows. This is just for Mac. Can you kindly let me know how to resolve this issue?. If you need the entire excel to test, please let me know.
感谢您对此的帮助。
JJ
推荐答案
Dictionary是VBScript中的一个对象(即Microsoft Scripting Runtime库)。这在MacOS下不可用。
Dictionary is an object in VBScript (i.e. the Microsoft Scripting Runtime library). This is not available under MacOS.
自定义字典类可在
https://sysmod.wordpress.com/2011/11/24/dictionary-vba-class-update/
你可以将那里提到的两个类模块合并到您的工作簿中。
You can incorporate the two class modules mentioned there into your workbook.
这篇关于视觉基础错误| Office 2016 for Mac |编译错误:未定义用户定义的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!