2.12.3 AddSimple


Description

Add a block of data from Worksheet to datarange

Syntax

VB: Function AddSimple(wks As Worksheet, r1 As ByVal Integer, c1 As ByVal Integer, r2 As ByVal Integer, c2 As ByVal Integer ) As Integer
C++: int AddSimple(Worksheet wks, int r1, int c1, int r2, int c2 )
C#: int AddSimple(Worksheet wks, int r1, int c1, int r2, int c2 )

Parameters

Return

Remark

Examples

VB

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

        app = New Origin.ApplicationSI
        wks = app.FindWorksheet("") ' get active worksheet to get data
        If wks Is Nothing Then
            MsgBox("Fail to get active worksheet")
            Exit Sub
        End If
        dr = app.NewDataRange()
        dr.AddSimple(wks, 0, 0, -1, 0) ' add the first column to datarange
        Dim data(10) As Double
        For ii = 0 To 10
            data(ii) = 2 * ii
        Next
        dr.SetData(data)
    End Sub

Version Information

8.0SR2

See Also