SAP VB.NET interop code to read a GuiTableControl object into a Blue Prism collection?

53 views Asked by At

What are the methods to be invoked to read a GuiTableControl object and save it as a collection in Blue Prism? I have the details of the GuiTableControl from Scripting Tracker software.

My current code:

Try
    Dim window = mySapSession.FindById(windowId)
    Dim myTable As GuiTableControl = window.FindById(gridNumber)

    Dim exep As Exception = Nothing
    Dim i As Integer = 0
    While exep Is Nothing 'scorro tutta la tabella fino in fondo (se una cella è stata visualizzata diventa leggibile anche se non è più nello schermo, se non è stata visualizzata non è leggibile)
        Try
            myTable.FirstVisibleRow = i
            i += 1
        Catch ex As Exception
            exep = ex
        End Try
    End While

    Dim colNames As Object = myTable.ColumnOrder

    For Each col As String In colNames
        dt.Columns.Add(col)
    Next

    Dim rowsNum As Integer = myTable.RowCount
    For j As Integer = 0 To rowsNum - 1
        Dim row As DataRow = dt.NewRow()
        For Each col As String In colNames
            row(col) = myTable.GetCellValue(j, col)
        Next
        dt.Rows.Add(row)
    Next

    success = True
    crippler.SAPOperations += 1

Catch ex As Exception
    success = False
    err = ex.Message
End Try
0

There are 0 answers