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

后端 未结 2 1323
失恋的感觉
失恋的感觉 2021-01-26 09:56

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:

相关标签:
2条回答
  • 2021-01-26 10:12

    Your solution should work.

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

    0 讨论(0)
  • 2021-01-26 10:37

    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")
    
    0 讨论(0)
提交回复
热议问题