更新时间:2023-02-13 18:00:47
我认为你在这里使用了错误的方法...你想使用粘贴方法而不是复制方法.
I think you are using the wrong method here... you want to use a Paste method not a copy method.
试试 Range.PasteSpecial 方法...应该可以解决问题.
Try the Range.PasteSpecial method... should do the trick for you.
这样的……
Excel.Range sourceRange = firstWorksheet.get_Range("A1", "J10");
Excel.Range destinationRange = secondWorksheet.get_Range("A15", "J25");
sourceRange.Copy(Type.Missing);
destinationRange.PasteSpecial(Microsoft.Office.Interop.Excel.XlPasteType.xlPasteFormulas, Microsoft.Office.Interop.Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, false, false);