We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Range.Copy with Add operation for PasteOptions

Hi,
Is there a feature in Aspose to copy range and paste values with Operation (Add/Sum) to destination range?
In documentation, there is PasteOptions, but it doesn’t contain Operation.

In VBA:
Workbook.Sheets(“Sheet1”).Range(“MyRange”).PasteSpecial Paste:=xlPasteValues, Operation:=xlAdd, SkipBlanks:=True, Transpose:=False

Thanks,

@asposebuyer,

Yes, there are limited options in PasteOptions. When I checked in MS Excel 2016, its Paste Special has “Add” but no “Sum” under Operation. Could you elaborate on “Sum”, is it same as “Add”? We will then add appropriate ticket for it into our database.

It’s “Add” only

@asposebuyer,

Thanks for your confirmation.

We have logged a ticket with an id “CELLSNET-48164” for your issue/requirements. The ticket is logged as following:
CELLSNET-48164 - Support operation under PasteOptions when copying ranges via Range.Copy

We will look into it soon.

Once we have an update on it, we will let you know here.

1 Like

@asposebuyer,
This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@asposebuyer
Please try the latest fix 21.6.2.
Aspose.Cells21.6.2 For .Net2_AuthenticodeSigned.Zip (5.5 MB)
Aspose.Cells21.6.2 For .Net4.0.Zip (5.5 MB)
Aspose.Cells21.6.2 For .NetStandard20.Zip (5.5 MB)
See following codes:
Range s = cells.CreateRange(“A2:B4”);
Range d = cells.CreateRange(“D9:E11”);
PasteOptions options = new PasteOptions();
options.OperationType = PasteOperationType.Divide;
d.Copy(s, options);

The issues you have found earlier (filed as CELLSNET-48164) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao