2.42.6 Copy


Description

Copy a block of data from the Worksheet on to the clipboard.

Syntax

VB:

Function Copy([ r1 As ByVal Object ], [ c1 As ByVal Object ], [ r2 As ByVal Object ], [ c2 As ByVal Object ], [ FullPrecession As ByVal Object ] ) As Boolean

C++:

bool Copy(_variant_t r1, _variant_t c1, _variant_t r2, _variant_t c2, _variant_t FullPrecession )

C#:

bool Copy(var r1, var c1, var r2, var c2, var FullPrecession )

Python:

Minimum Origin Version Required: 2018 SR0

def Copy(self, nR1=0, nC1=0, nR2=-1, nC2=-1, bFullPrecision=False):

Parameters

r1
Zero based index of first row to copy.
c1
Zero based index of first column to copy.
r2
Zero based index of last row to copy.
c2
Zero based index of last column to copy.
FullPrecession
Whether to force copy full precision.

Return

True if the copy was successful; otherwise false.

Remark

Examples

VBA

Dim myobj As Origin.ApplicationSI
Dim myWks As Origin.Worksheet
Dim myrng As Range

'Open a new instance of the Origin application
Set myobj = GetObject("", "Origin.ApplicationSI")

myobj.Execute ("doc -mc 1")
'base on 0

'we can create a opj test_wks, there are two worksheet book, and some layers
'load opj
myobj.Load ("c:\\test_wks.opj")

Set myWks = myobj.WorksheetPages(0).Layers(0)

'copy the worksheet range, and paste to excel 'A5:B24'
bSuccess = myWks.Copy(1, 2, 20, 3, True)

Set myrng = Range("A5:B24")
myrng.PasteSpecial

Version Information

8.0SR2

See Also