CATIA VBA Enable use of “Scripting.Dictionary” in .CATScript

别等时光非礼了梦想. 提交于 2019-12-04 05:51:52

问题


When running a .CATScript whose code was copied from the VBA environment and functions as intended when run in the VBA environment I get the following error:

The scripting engine has reported the following error:

Source: Microsoft VBScript runtime error

Description: Variable is undefined: 'Scripting'

Line: 9

Column: 4

How can I have this script use the "Microsoft Scripting Runtime" reference library?


回答1:


Your solution should work.

To be able to use "Scripting.Dictionary" in VBA, go to Tools->References and select "Microsoft Scripting Runtime".




回答2:


I've searched on google for a bit and I believe the following would solve my problem:

'in original VBA code:
Dim dict As Scripting.Dictionary
Set dict = New Scripting.Dictionary

'To have this work in .CATScript, replace the code above with:
Dim dict
Set dict = CreateObject _
("Scripting.Dictionary")


来源:https://stackoverflow.com/questions/48264708/catia-vba-enable-use-of-scripting-dictionary-in-catscript

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!