How to copy single column from excel to clipboard ?

growler

Member
Hi guys,

I have an excel sheet which has multiple columns named col1, col2, col3. I want to copy only the col1 into clipboard and then paste it to target application from clipboard.

There are two ways I can think of to achieve this:
First write that column value to another excel sheet then use "Copy" action to move the data into clipboard.

Secondly, fetch the whole source excel sheet into a collection and then have only the col1 copied to another collection. This way it will be much faster but I am not sure how to copy this data into clipboard.

Please suggest better ways to do this. Also if there's some action available to get the collection data into clipboard. Thank you
 

VJR

Well-Known Member
Hi growler,

There doesn't appear to be a ready made action to copy the collection data to clipboard. You will need to write a specific code stage to do that. Since the code is already written in the available actions to copy the data from Excel to the clipboard you can think of making use of your first choice.
The Copy action will directly at once copy all the excel rows into the clipboard in one shot whereas you might have to loop through each row of the collection and then copy to the clipboard if you go by the Code stage so do a research and see if there is a code to copy datatables (collections are stored as datatables) into the clipboard directly without looping and then make a decision.
 
Top