How to assign query with the script which is already copied to clipboard via Excel Macro buttonn?

excel
studio

#1

Hi all, I’m a new learner in UiPath. I am trying to automize my excel template for the daily data reportand, and I have encountered a puzzling problem. Couly you please give me a hand?

Here is the situation:
In an Excel workbook, I click the button (already assigned with Macro script) “Copy SQL Script To Clipboard”. Then I’d like to use UiPath to execute the copied SQL Script. As you konw, next I will use the Funtion “Assign”. Usually, I can just press “Cltrl +V” to paste the script into the blank after “=”
%E5%9B%BE%E7%89%87.
However, the copied SQL Script varies from day to day, and I have to exceute the Script every day.
So how can I make the query execute different scripts without manually pressing “Ctrl+V”?
Maybe it involves the combination of dynamic query assignment and hot key. I’m not sure.

I’ll appreciate if you can offer some suggestions.


#2

You can use various clipboard activities. As your script text is already copied to clipboard you can use “Get from clipboard” to get the script text in a variable.
You can assign the value of variable easily in assign instead of ctrl+V.
Other clipboard activities are- Copy Selected Text and Set to Clipboard
Thanks


#4

Thanks for the reply. I use “Get from clipboard” and define its output as a variable “content”. Then I assign query as = “content” and run it. But the process fails. This is the sequence:


copy script and excute it in Orcale SQL.xaml (6.2 KB)
Did I create the sequence properly?