How to Execute Split Option when Exporting a Summary using COM Automation?

Al_22614
Al_22614 Altair Community Member
edited November 2021 in Community Q&A

I am trying to Export a Summary where I want to Split the Export into seperate, distinct tales based on the first Key values in the Summary using COM Automation.  

Can anyone help me to craft the VBA COM scripting to Execute the above Split Option when Exporting a Summary?

Below is partial extract of the VBA COM scripting:

Set MonarchObj = GetObject("", "Monarch32")

If MonarchObj Is Nothing Then
Set MonarchObj = CreateObject("Monarch32")
End If

openfile = MonarchObj.SetProjectFile(ProjFolder & "DummyProj.dprj")

If openfile = True Then
'Set filter and export to Excel XLSX
'
MonarchObj.CurrentSummary = CHEPSUM
EXPFILE5 = MonarchObj.JETExportSummary(CHEP_Folder & CHEPFILE, CHEPSUM, 2)
MonarchObj.CurrentSummary = BRWNSUM
EXPFILE6 = MonarchObj.JETExportSummary(CHEP_Folder & BROWNFILE, BRWNSUM, 2)
'
Else
GoTo UStop
End If
MonarchObj.CloseAllDocuments
MonarchObj.Exit
Set MonarchObj = Nothing

For the two summaries (CHEPSUM and BRWMSUM) I want the Export to execute the summary option: Each distinct value of the first key to make a seperate table"

Thanks in advance for your help.

Al

Answers

  • Mahmoud
    Mahmoud
    Altair Employee
    edited November 2021

    Hi Al,

    I checked the Monarch class object in object browser, and didn't see a method for setting the 'Each distinct value of the first key to make a separate table' option. 

    I suggest you create two exports, one for each summary in Monarch Classic, and save them in the project file.  Then make a reference to the Project file, then use the RunAllExports() or RunExport(String) methods.

    The following shows the Monarch Classic class object methods and properties:

    image

    Regards

    Mo

  • Al_22614
    Al_22614 Altair Community Member
    edited November 2021

    Thanks Mo... Works like a charm!!!   You guys are the best!!

    Many Thanks

    Al