admin管理员组

文章数量:1290935

The objective is to replicate the formats of source sheets in Excel to target sheets without recourse to the Excel.Range.PasteSpecial function of Microsoft.Office.Interop, on account of the fact that this function uses the clipboard and is slow. Are there any alternatives to this:

source.Range[address].Copy();
target.Range[address].PasteSpecial(Excel.XlPasteType.xlPasteFormats, Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, false, false);

The option of replicating the formats by hand with copying the font and colour is not a reliable solution and should be avoided. Is a potential solution may be a C API interaction?

本文标签: cPasting Excel formats in MicrosoftOfficeInterop without clipboardStack Overflow