I have copied to clipboard and I want to paste that directly into excel

Hi All,

I have a data in the clipboard and I want to paste it directly to a excel because I want to retain the structure. I tried by sending hotkeys as ctrl+v and tried with type into and sending same keys but did not work. Can any one help me with this.
Note:Also tried using get from clipboard and output saved in a string/dt and pasting it in excel is changing structure.

Thanks in advance

1 Like

Hi,

Did you tried using a “Select Range” activity from UiPath and after that use the Hotkeys activity with the “Ctrl+V” (without anything in the selector)?

The Select Range Activity should active the Cell/range that you want to paste.

Best

Hi Brett22,

Nope not used let me try using that.
Thanks for quick response.

Thanks,
Hari

  • Use Get from clipboard.
  • In excel, select the range and change the format as text.
  • Use Write cell activity.

Hi Vivek,

From clipboard to which variable should i get data? String?

You are correct… In Get from Clipboard, we should get output as String Variable.

That will paste everything in single cell bro.

Tried did not work bro, so what I am doing is open excel and then using right click and selecting paste( via click activity).

Thanks,
Hari

Hi Harinathreddy,

From where are you getting the data that has formatting which is lost when pasting (using Ctrl+v or getting from clipboard activity)

If you run a script that will store everything in a variable then, while reading it if you replace newline character by a delimiter and then rebuild the string in uipath then the formatting will be intact.

The attached script is an example, tailor it to your needs and hope it helps.

Hi,

Could you please attach a sample script?
Thanks in advance!

Hi @JIBIN_MANUAL

Welcome to UiPath Community

Can you be more specific what you require and till where you are on extracting the data :slight_smile:

For starters try with write cell in excel activity, hope this helps :slight_smile:

Hi @Shubham_Varshney

Thanks for the warm welcome. The write cell activity was writing the entire data into once cell (I was copying the data from BOM from a Solidworks drawing and wanted to keep the source formatting).

I solved this issue bu using hot keys by these steps. Get from Clipboard→Set to clipboard→Open application (excel)→Type into - “[K(Alt)]”+“h”+“v”+“t”
this directly pasted the data with source formatting into the excel sheet.

1 Like

Ahhh perfect :slight_smile:

Happy to see you figure it out yourself!!!

To avoid issue, please do add a 5 delay between keys in the properties tab of type into :slight_smile:

1 Like

Hi @harinathreddy.yn,

Here is an activity to paste the data from clipboard.

Regards
Balamurugan.S