cancel
Showing results for 
Search instead for 
Did you mean: 

How to duplicate worksheet in excel with out spying?

Hello,

How to duplicate worksheets with out spying the 

I have a worksheet with lot of conidtional formating and have different color with out reading and writing is there way we can exactly duplicate the worksheet but with out spying?

------------------------------
Harish Mogulluri
developer
Ics
America/New_York
------------------------------
-----------------------
If I answered your query. Please mark it as the Best Answer

Harish Mogulluri
3 REPLIES 3

Hello Harish,

you can use below action from ms excel VBO, it will create a copy of the worksheet, later you can rename the duplicate sheet as required.

19858.png

------------------------------
MuraliKrishna
Senior Consultant - Automation Developer
------------------------------

Thank you. I didn't notice that action.so I have one another question can we highlight ( some color)  cell in excel? With out spying?

------------------------------
Harish Mogulluri
developer
Ics
America/New_York
------------------------------
-----------------------
If I answered your query. Please mark it as the Best Answer

Harish Mogulluri

Hi Harish,

You can achieve the highlighting of cells in multiple ways. If you have the excel file ready as a template you can perhaps set the conditional formatting rules in the excel file directly. As you keep populating the cells in the excel file from Blue Prism process, the cells will get highlighted automatically based on the conditional formatting rule that have set previously.

If you want to dynamically set the cell color, extend the Excel VBO capability by creating an additional action using code stage with below parameters and code:

Input:

handle : The current excel instance that holds you excel session.
row_reference : The row number of the cell that you want to highlight.
column_reference: The column number of the cell that you want to highlight.
red_value: The value of the Red tone pixel ranging from 0 to 255.
green_value: The value of the Green tone pixel ranging from 0 to 255.
blue_value: The value of the Blue tone pixel ranging from 0 to 255.

Code:

GetWorkbook(handle,Nothing).ActiveSheet.Cells(row_reference,column_reference).Interior.Color = RGB(red_value, green_value, blue_value)


Before using this code use the keep the excel handle activated by using Create Instance, Open Instance or Attach activity and open your desired workbook and activate the worksheet where you want to perform this operation. Depending on your use case and logic you can either call this action once or maybe in a loop as per some condition that you want to set for highlighting by passing dynamic row and column number for the cells.

------------------------------
Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blueprism 6x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.