Not an object reference Error.

Not an object reference Error.

  • 16 Januar 2020 um 5:34 pm #35422
    [email protected]
    Teilnehmer

    hi, have an problem. I need to control a gridview object by basic script. But error occur.Please hekp

    Dim DatabaseRow As Integer
    Dim DatabaseColume As Integer
    Dim objGrid As New GridWndCmdTarget

    Sub Main()

    Set objGrid = GetSynopticObject.GetSubObject(„InstrinsicError_GridView“).GetObjectInterface ‚ InstrinsicError_GridView is name of the Grib object
    DatabaseRow = objGrid.GetRowCount
    DatabaseColume = objGrid.GetColCount
    end sub

  • 17 Januar 2020 um 12:02 pm #35423
    Robin
    Teilnehmer

    Hi Jeff,
    the syntax to interface objects via script depends on the script context.
    In this case my advice is to use the script in the context of the synoptic.

    You can copy this code in the script context of a button inside the same screen….

    Public Sub Click()
    Dim DatabaseRow As Integer
    Dim DatabaseColume As Integer
    Dim objGrid As New GridWndCmdTarget

    Set objGrid = GetSynopticObject.GetSubObject(„MyGrid“).GetObjectInterface ‚ MyGrid Is Name of the Grib Object
    DatabaseRow = objGrid.GetRowCount
    DatabaseColume = objGrid.GetColCount

    Debug.Print(DatabaseRow)
    Debug.Print(Colume)
    End Sub

    Regards
    Robin

  • 18 Januar 2020 um 5:03 am #35426
    [email protected]
    Teilnehmer

    Hi Robin,
    Thank you for your reply. I know this will work. but is that possible i do it in basic script? i cant find any example how to write the code in basic script. I need read from mysql database and paste in gridview ( it may be a lot of data therefore i scare it will consume the memory and may affect the other process. If do it at basic script i can use separate thread to reduce the memory consumption) . then take the data from grid view and save to excel file.

  • 21 Januar 2020 um 9:46 am #35432
    Kristof70
    Teilnehmer

    Hi Jeff,
    Are you running the application with administrator rights?
    BR
    Kris

Du musst angemeldet sein, um auf dieses Thema antworten zu können.