How to copy a column of data in excel to clipboard with Python and paste to SAP

Hello All,

I need to copy a entire column “K” from an Excel file and save it the clipboard. My script then opens SAP and there is a portion where i will upload that data to the file. This is the best way to ensure the data from the excel file transfers to the SAP module. My issue is everywhere i search I can not find a way to do this. I can copy one cell or data point to the clipboard, i need to copy an entire column and paste it.

All help will be greatly appreciated.

@duranil

Welcome to the uipath community.

Follow below steps to do this.

  1. First use Read Range activity to read the data from excel file and will give you output as DataTable and say ‘yourDT’.

  2. And then below expression to read only K- column data.

           newDT = yourDT.DefaultView.ToTable(False,"K-ColumnName")
    
  3. And then use Output DataTable activity to convert DataTable into string.

  4. And then use Set to Clipboard activity and pass that output string to this as input.

  5. Finally use Copy Selected Text activity to copy from clipboard and paste it where you want.