I created a Excel VBO Extension object to add new functionality to the Excel steps. In my new object I would like to color a cell based on input.
For this I use the Create instance, Open Workbook, Show actions from the original Excel VBO. The following action is my new action, but I always get the following error: "Internal : Could not execute code stage because exception thrown by code stage: The given key was not present in the dictionary."
In my new action I use the Activate Worksheet, CheckInstanceAndWorkbook, CheckInstanceHandle actions copied from the original Excel VBO and recreated in my new Excel VBO Extension object.
How can I catch the instance with my object, that has been already created by teh original Excel VBO?
Thank you.
The error that you have indicates that Actions that you are using:
Create instance, Open Workbook, Show actions from the original Excel VBO
Belong to a different part of code which generates your handle variable in order for Blue Prism to manipulate your Excel Application.
Since your new object is under your Excel VBO Extension along with Activate Worksheet, CheckInstanceAndWorkbook, CheckInstanceHandle actions that were recreated, they do not have access to the handle variable created by a different object (in this case original Excel VBO).
So imagine this as having two functions were as the first one generates the variable as output but the second one does not receive it as input.
So what you need to do is to duplicate all the actions that you need from original Excel VBO to your Excel VBO extended and use actions of one object only.
Hope these information will be useful.