Range Excel to Clipboard

excel
uiautomation

#1

Good afternoon,

I would like to know how to perform the copying of a range from excel to clipboard and then paste it into an SAP transaction.

Thank you very much.


#2

Hi John,

You can do that by :

  1. Drag β€œExcel Application Scope” from activity pane
  2. Place β€œSelect Range” activity in it and specify the range
  3. Use β€œCopy Selected Text” activity and place he output in a variable
  4. Push the variable to SAP transaction

You can also, use Read Range activity and place the content in a datatable variable and then push that into SAP transaction.

Regards,
V


#3

Hi Vikas,

When using Copy Selected Text generated this error:

IngresoSAP has thrown an exception

Message: One or more errors occurred.

Source: Copy selected text

Exception Type: AggregateException

System.AggregateException: One or more errors occurred. β€”> System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func1 action, Int32 timeoutMS, Int32 retryCount) --- End of inner exception stack trace --- at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom) at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom) at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) ---> (Inner Exception #0) System.Exception: Empty clipboard at UiPath.Core.Setup.GetClipboardText() at UiPath.Core.Activities.ClipboardWrapper.<>c.<GetText>b__4_0() at UiPath.Core.Activities.Retry.Do[ResultType](Func1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #1) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #2) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #3) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #4) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #5) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #6) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #7) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #8) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #9) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #10) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #11) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #12) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #13) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #14) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #15) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #16) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #17) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #18) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #19) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #20) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #21) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #22) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #23) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #24) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #25) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #26) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #27) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #28) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #29) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #30) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #31) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #32) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #33) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #34) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #35) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #36) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #37) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #38) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #39) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #40) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #41) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #42) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #43) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #44) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #45) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #46) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #47) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #48) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

β€”> (Inner Exception #49) System.Exception: Empty clipboard
at UiPath.Core.Setup.GetClipboardText()
at UiPath.Core.Activities.ClipboardWrapper.<>c.b__4_0()
at UiPath.Core.Activities.Retry.Do[ResultType](Func`1 action, Int32 timeoutMS, Int32 retryCount)<β€”

Thanks.


#4

Looks like blocked access to clipboard.

Does it reproduce if you send a Ctrl+C hotkey instead of CopySelectedText activity?


#5

Hello,

or just assign it like this

toPaste & row.Item(β€œNΒΊ pers.”).ToString & SYSTEM.Environment.NewLine

try to assign it like this, is this what you tried?

clipboard.xaml (7.5 KB)

regards


#6

Thanks to everyone, it already worked for me.