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

Free Support Forum - aspose.com

src.Copy(src) overwrites src with empty values

in aspose.cell pre 4.4 this code worked without the check that i <> src.Column

For i = fromCol To lastCol
If i <> src.Column Then 'don’t copy onto self, ends up writing nothing over self
ws.Cells(row, i).Copy(src)
End If

after upgrading to 4.5 my application bugged out because src was erased when it was copied over itself.

I admit that copying over itself is stupid,(maybe it should throw) but it probably shouldn’t result in erasing the source cell.

Adding the check above make things work fine for me, but I thought you might want to know about this since it could be considered a bug.


We will figure out the issue. If you want to copy a cell value to itself, I think you may try as:


ws.Cells(row, i).PutValue(src.Value)


Thank you.


Please try this fix.

We will do nothing if cell copy itself.