Choose Language Hide Translation Bar
Community Trekker

VB Automation Concatenate to First Data Table

Hello, I am trying to open an excel file as a datatable, then open another data table which already exists. I then want to concatenate the new datatable to the first, replacing the first data table. This is an option when using concatenate in JMP, but I can't find it in the automation documentation. This below code works to open the two data tables and concatenate them to create a new data table, but ideally I would like to conatenate onto the master data table. I could just save over it, but I don't like that solution. Is this possible?


Any other critique on my approach is welcome as well.


Sub Main()
    Dim MyJMP As JMP.Application
    Dim JMP_Doc As JMP.Document
    Dim Excel_Import As JMP.DataTable
    Dim Master As JMP.DataTable
    Set MyJMP = CreateObject("JMP.Application")
    MyJMP.Visible = True
    Set JMP_Doc = MyJMP.OpenDocument("Path1")
    Set Excel_Import = JMP_Doc.GetDataTable
    Set JMP_Doc = MyJMP.OpenDocument("Path2")
    Set Master = JMP_Doc.GetDataTable
    Call Excel_Import.AddToConcatList
    Call Master.AddToConcatList
    Master = Master.Concatenate
End Sub


0 Kudos