Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Apr 2, 2020
Messages
20
Location
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.
 
No I run it from Catia
 
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