Hi Rinesh,
Currently, I don't think there is any action to achieve this functionality in the current 'MS Excel' or 'MS Excel - Extended' VBO perhaps someone can confirm on the same as well.
But you can achieve this functionality by extending either 'MS Excel' or 'MS Excel - Extended' VBO by creating a new action within the object.
NOTE: I would recommend create a duplicate object of these objects and make your changes there so that you always have a backup with you in case anything goes wrong.Now, you need to create a new action in your already existing Excel VBO business object named
'Change Worksheet Tab Color' and provide the following input parameters to your action:
Handle : This is a number type data item which will hold the current session dictionary value.
Workbook : This is a text type data item where you need to pass the workbook name that you might get from 'Create Workbook' or 'Open Workbook' action.
Worksheet: This is a text type data item which indicates the name of the worksheet in your excel workbook file whose tab color you want to change.
R : This is a number type data item which can consists of value ranging between 0 and 255 in order to determine the red color pixel in your RGB color combination.
G : This is a number type data item which can consists of value ranging between 0 and 255 in order to determine the green color pixel in your RGB color combination.
B : This is a number type data item which can consists of value ranging between 0 and 255 in order to determine the blue color pixel in your RGB color combination.
Now, you can add a code stage named
'Change Worksheet Tab Color' and add the following inputs parameter and map the data items to it:
Code:
Dim ws, excel, sheet As Object
ws = GetWorksheet(Handle, Workbook, Worksheet)
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
sheet.Tab.Color = RGB(R, G, B)
You should have your workflow ready as shown below:
Now, publish your action and then use all the actions of the same business object where you have done the changes in your process studio while interacting with the excel file in order to avoid any exceptions. I have a sample process studio workflow shown below:
Here, I am creating an excel instance, then opening my excel file, then making it visible on the screen and then I use my new created action which has the below parameters:
So here since my R value is 255 which is maximum while G and B values are 0 hence, the resultant color would be red since R is dominant and has maximum value which means that tab color of my
'Parameters' sheet should be
Red.
Now, before running this action my file looks like this:
After executing the action, you can observe below that the color of the sheet tab got converted to Red:
So just by manipulating with the R, G and B input parameters in this action you can change any specific worksheet tab to any color you want.
----------------------------------------------------------------Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in futureRegards,Devneet MohantyIntelligent Process Automation Consultant | Sr. Consultant - Automation Developer,Wonderbotz India Pvt. Ltd.Blue Prism Community MVP | Blue Prism 7x Certified ProfessionalWebsite: 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.