Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling CATScript from VBA

Status
Not open for further replies.

VojtaR

Automotive
Apr 2, 2020
20
CZ
Hello everyone,

I am having trouble with my macro which should call CATScript. Can anyone help?

I am getting error on line "catScriptLibraryTypeDirectory"

Code:
Private Sub CB_format_BOM_Click()
  
    Dim param()
    Dim oFilePath, oFileName, oM As String
    oFilePath = sMainFolder & "\FORMAT BOM\"
    oFileName = "04_V5R28_BOM_creator-Format_table.CATScript"
    oM = "04_V5R28_BOM_creator-Format_table.CATScript"
    CATIA.SystemService.ExecuteScript(oFilePath & oFileName, catScriptLibraryTypeDirectory, oM, "CATMain", param)
    Exit Sub

End Sub

Thank you for any help.
 
Replies continue below

Recommended for you

It helped, was not quite there yet.... but with little tweaking, thic code below worked.

Thank you!!

Code:
Private Sub CB_format_BOM_Click()
    Unload UserFormStart
    Dim param()
    Dim oFilePath, oM As String
    oFP = sMainFolder & "\FORMAT BOM\"
    oM = "04_V5R28_BOM_creator-Format_table.CATScript"
    CATIA.SystemService.ExecuteScript oFilePath, INFITF.CatScriptLibraryType.catScriptLibraryTypeDirectory, oM, "CATMain", param
    Exit Sub
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top