We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to implement the 'Insert copied Cells' functionality.


If you have an Excel worksheet you can do the following directly in the application: (The result of a capture macro)

    Range("F3").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("A3").Select
    Selection.Insert Shift:=xlDown

which essentially selects one or more cells from one location, then selects a new location and pastes the copied cells at the new location, pushing down the cells at the new location, preserving formatting and updating any formulas.

How would this be done using XLSIO method calls?

3 Replies

DB Dilli Babu Nandha Gopal Syncfusion Team March 20, 2015 11:12 AM UTC

Hi Karl,

Thank you for using Syncfusion products.

Currently there is no direct method to perform InsertCopiedCells functionality. Whereas, this can be achieved by a workaround in the usage level. We have prepared a sample illustrating this behavior which is just a modal and it can be downloaded from the following link. This can be enhanced depends on the requirement. Kindly refer to the sample and let us know if this helps.

Sample link: http://www.syncfusion.com/downloads/support/forum/118572/CopyingRange220523571.zip

Please let us know if you have concerns.

Regards,

Dilli babu.



KH Karl Hauschildt March 20, 2015 01:17 PM UTC

I spent quite a while playing with this and am not yet sure if it solves my issue.
Please see the attached, modified, sample xls file and note that when the test program is run and isDown = true
that the formula cell moves and is updated in a peculiar way. 


Attachment: Sample1_c01959ab.zip


DB Dilli Babu Nandha Gopal Syncfusion Team March 23, 2015 05:02 PM UTC

Hi Karl,

Thank you for updating us.

We are able to reproduce the reported issue from our side This issue can be resolved by using MoveTo() instead of CopyTo() while moving existing cells to down in InsertCopiedCell(). The Sample which illustrates this behavior can be downloaded from following link.

Sample link: http://www.syncfusion.com/downloads/support/forum/118572/CopyingRange152466992.zip

While opening a generated excel file, a circular reference exception is thrown in MS Excel. We have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Regards,
Dilli babu.


Loader.
Live Chat Icon For mobile
Up arrow icon