In my application I use spreadsheetgear to work with Excel files. I use the following code:
//move incorrect to aux
incorrectLine.Select(); //select the line to be moved
wbkView.Cut();
auxLine.Select();
wbkView.Paste();
//move correct to incorrect
correctLine.Select(); //select the line to be moved
wbkView.Cut();
incorrectLine.Select();
wbkView.Paste();
//move aux to correct
auxLine.Select(); //select the line to be moved
wbkView.Cut();
correctLine.Select();
wbkView.Paste();
I receive from time to time the following error:
Requested Clipboard operation did not succeed.
with the StrackTrace:
at System.Windows.Forms.Clipboard.ThrowIfFailed(Int32 hr)
and ErrorCode = -2147221040
From what I understand there is a problem if the clipboard is used by other process so I want to know if exists another mode to switch two lines from an Excel file without using the clipboard.