2.12.8 GetData


Description

Get all data of one subrange in this datarange

Syntax

VB: Function GetData([ Index As ByVal Object ], [ format As ByVal Object ] ) As Object
C++: _variant_t GetData(_variant_t Index, _variant_t format )
C#: var GetData(var Index, var format )

Parameters

Index
--
format
--

Return

Remark

Examples

VB

    Sub GetData()
        Dim app As Origin.IOApplication
        Dim dr As Origin.DataRange
        Dim wks As Origin.Worksheet
        app = New Origin.ApplicationSI
        wks = Nothing
        Try
            wks = app.FindWorksheet("") 'get active wks
        Catch ex As Exception
        End Try
        If wks Is Nothing Then
            MsgBox("Can not get active worksheet")
            Exit Sub
        End If
        dr = wks.NewDataRange(0, 0, -1, 0) 'add first column of wks to datarange
        dr.Name = "mydata"
        Dim data(2, 32) As Object
        data = dr.GetData(0, Origin.STGDATAFMT.STGDATAFMT_BLOB)
        Dim str As String
        Dim dValue As String
        dValue = data(1, 1).ToString() 'get the value of the first column's first cell of worksheet
        str = "Value of the first cell of the first column is " + dValue
        MsgBox(str)
    End Sub

Version Information

8.0SR2

See Also