Paste

Paste([destination])

Pastes the contents of the clipboard to the current sheet.

Parameters:

Name Type Default Description
destination ApiRange null

The cell range where the clipboard contents should be pasted. If this argument is omitted, the current selection is used.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oRange = oWorksheet.GetRange("A1");
oRange.SetValue("This is a sample text which is copied to the clipboard.");
oRange.Copy();
var oCopiedRange = oWorksheet.GetRange("A2");
oWorksheet.Paste(oCopiedRange);
builder.SaveFile("xlsx", "Paste.xlsx");
builder.CloseFile();

Resulting document