Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IRange Interface > CopyTo Method : CopyTo(IRange,Boolean) Method
Represents the destination Range to copy.
Represents if the pasteLinkOptions implement or not .

CopyTo(IRange,Boolean) Method

Copies the Range to the specified destination Range with copy options.
Syntax
'Declaration
 
Overloads Function CopyTo( _
   ByVal destination As IRange, _
   ByVal pasteLink As Boolean _
) As IRange
'Usage
 
Dim instance As IRange
Dim destination As IRange
Dim pasteLink As Boolean
Dim value As IRange
 
value = instance.CopyTo(destination, pasteLink)

Parameters

destination
Represents the destination Range to copy.
pasteLink
Represents if the pasteLinkOptions implement or not .

Return Value

Returns the copied Range.
Example
The following code illustrates how to copy the Range with pasteLink options.
ExcelEngine engine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet worksheet = workbook.Worksheets[0];
IRange source = worksheet["A1:D5"];
IRange destination = worksheet["E10"];
// Copy range as link from source to destination
source.CopyTo(destination, true);
workbook.Version = ExcelVersion.Excel2013;
workbook.SaveAs("CopyRange.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also