PasteSpecial

function PasteSpecial(
  sPasteType: PasteType = "xlPasteAll",
  sPasteSpecialOperation: PasteSpecialOperation = "xlPasteSpecialOperationNone",
  bSkipBlanks: boolean = null,
  bTranspose: boolean = null,
): void

Description

Pastes the Range object to the specified range using the special paste options.

Parameters

sPasteTypePasteTypedefault: "xlPasteAll"

Paste option.

sPasteSpecialOperationPasteSpecialOperationdefault: "xlPasteSpecialOperationNone"

The mathematical operation which will be applied to the copied data.

bSkipBlanksbooleandefault: null

[bSkipBlanks=false] - Specifies whether to avoid replacing values in the paste area when blank cells occur in the copy area.

bTransposebooleandefault: null

[bTranspose=false] - Specifies whether the pasted data will be transposed from rows to columns.

Returns

void

Try It

var oWorksheet = Api.GetActiveSheet();
var oRange = oWorksheet.GetRange("A1");
oRange.SetValue("test");
oWorksheet.GetRange("A1").Copy();
oWorksheet.GetRange("B1").PasteSpecial("xlPasteAll", "xlPasteSpecialOperationNone", false, false);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).