cancel
Showing results for 
Search instead for 
Did you mean: 

Send Keys to Excel through Code Stage

nikhiln
Level 5
Hi All,

I need copy a specific section in Excel as an image using Excel short cut (Alt , H, C , P  Enter ) I can perform that action.
As Excel VBO is limited to specific functionality,  Is is possible to do the same via code Stage.

Thanks


------------------------------
Nik
------------------------------
11 REPLIES 11

GeoffHirst
Staff
Staff
Hi Nik,

Thanks for using Blue Prism.

There is another VBO called Windows Sendkey you should be able to find it here .

Please advise if this helps.

regards

Geoff Hirst

------------------------------
Geoff Hirst
Partner Pre Sales
Blue Prism
------------------------------
Geoff Hirst Senior DX Engineer - Digital Exchange - EMEA SS&C Blue Prism

Hi Geoff,

Thank you for the VBO link, Is there any documentation or use case representation for using this VBO .

Thanks

------------------------------
Nik
------------------------------

AntonHosang1
Level 4
Hi Nik, why not make another Excel Action, and use this code if you already have the region selected. 
Selection.CopyPicture(Appearance:=1, Format:=-4147)
Tweak as necessary to make it more flexible:

------------------------------
Anton Hosang
RPA Developer
Smart Automation Services
Europe/London
------------------------------

Hi Anton, 

Thanks for the suggestion but, I am not using spy mode for Excel Operations.

------------------------------
Nik
------------------------------

Hi Nik,

I am not sure about an actual example but there is a user guide if you sign into the Digital Exchange and search again for the asset, you can be taken to the full page description where you will find a link to the user guide. It is possible that an example exists in their download file.

An alternative for you. There is the Utility - Strings asset, this should be in your Blue Prism install location. There is an action called Escape Sendkeys String that might help or at least give you some direction to create exactly what you need yourself.

regards


------------------------------
Geoff Hirst
Consultant - Digital Exchange - EMEA
Blue Prism
------------------------------
Geoff Hirst Senior DX Engineer - Digital Exchange - EMEA SS&C Blue Prism

Hi Nik, it's not referring to spying
You asked for a code stage (" Is is possible to do the same via code Stage.")

So if you wish to use the Excel VBO and simply make another code page in there, then the code above can help. It would work on a range that is already selected. Otherwise you can tweak it to put the range address instead of 'Selection'.


------------------------------
Anton Hosang
RPA Developer
Smart Automation Services
Europe/London
------------------------------

Hi Anton,

Apologies for misunderstanding, can you send me the complete code .

Thanks

------------------------------
Nik
------------------------------

Put 4 inputs: handle, workbookname, worksheetname, address
No Outputs needed.
This will need the range address like "A1:C5" for the area to copy as picture.

Dim ws As Object = GetWorksheet(handle, workbookname, worksheetname)
ws.Range(address).CopyPicture(Appearance:=1, Format:=-4147)


------------------------------
Anton Hosang
RPA Developer
Smart Automation Services
Europe/London
------------------------------

Hi Anton,

Thanks for the code, I am able to copy the image, Can i use the same syntax o Paste the image to another excel cell?

------------------------------
Nik
------------------------------