Posted 8 September 2017, 6:05 am EST
Hi
I'm copying a range of cells in order to paste all the cell formats to new cells that are inserted in a loop.
The code is executed always in the same way (it's a report that is build always with same data). The problem is that sometimes I get this error when using "ClipboardCopy":
"Requested Clipboard operation did not succeed"
this is the code I'm using
with sp1.sheets(0)
.AddSelection(row1, col1, 1, last_col - col1 + 1)
crange = fp.ActiveSheet.GetSelection(0)
.ClipboardCopy(crange, Spread.ClipboardCopyOptions.All)
.ClearSelection()
While rd.Read
...
.SetActiveCell(r, col1)
.ClipboardPaste(Spread.ClipboardPasteOptions.All)
...
end While
end with
Should I create a kind of loop to wait and retry several times?
Regards