2.12.14 SetData


Description

Set data of each subrange

Syntax

VB: Function SetData(data1 As ByVal Object, [ data2 As ByVal Object ], [ data3 As ByVal Object ] ) As Integer
C++: int SetData(_variant_t data1, _variant_t data2, _variant_t data3 )
C#: int SetData(var data1, var data2, var data3 )

Parameters

data1
--
data2
--
data3
--

Return

Remark

Examples

VB

    Sub Add()
        Dim app As Origin.IOApplication
        Dim dr As Origin.DataRange
        Dim wks As Origin.Worksheet

        app = New Origin.ApplicationSI
        wks = app.FindWorksheet("") ' get the active wks
        If wks Is Nothing Then
            MsgBox("Can not get an active worksheet")
            Exit Sub
        End If
        dr = wks.NewDataRange()
        Dim xData(0 To 9) As Double
        Dim yData(0 To 9) As Double
        For ii = 0 To 9
            xData(ii) = ii + 1
            yData(ii) = 10 - ii
        Next

        dr.Add("X", wks, 0, 0, -1, 0) 'add first column of wks as X
        dr.Add("Y", wks, 0, 1, -1, 1) 'add sceond column as Y
        dr.SetData(xData, yData) 'update data in wks
    End Sub

Version Information

8.0SR2

See Also