CATIA VBA启用对“脚本。字典”的使用。在.CATScript中 [英] CATIA VBA Enable use of "Scripting.Dictionary" in .CATScript

查看:385
本文介绍了CATIA VBA启用对“脚本。字典”的使用。在.CATScript中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行.CATScript,其代码是从VBA环境复制的,并且在VBA环境中运行时按预期运行,因此出现以下错误:

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:

源:Microsoft VBScript运行时错误

Source: Microsoft VBScript runtime error

说明:变量未定义:'脚本'

Description: Variable is undefined: 'Scripting'

行:9

列:4

如何让此脚本使用 Microsoft Scripting Runtime参考库?

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

推荐答案

我在Google上进行了搜索,相信以下内容可以解决我的问题:

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")

这篇关于CATIA VBA启用对“脚本。字典”的使用。在.CATScript中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆