cancel
Showing results for 
Search instead for 
Did you mean: 

Is There Any Guide or Tutorial for Code Stage of Blue Prism

SIMENG_WANG
Level 3
Hi, all I am wondering what is the use of code stage of Blue Prism and is there any guide or templet about it that I could learn by myself? Thank you!
10 REPLIES 10

__
Level 4
You are not looking for a BP tutorial then, the code stage accepts Visual Basic or C# code and you will have to learn either one of these languages. One thing you have to know is that when you create a code stage you are actually creating a method (a Sub in Visual Basic). The code stage accepts any code that can be inside a Sub.

John__Carter
Staff
Staff
The code stage if effectively a Sub with ByVal and ByRef parameters, eg Sub AddNumbers(ByVal input1 As Decimal, ByVal input2 As Decimal, ByRef output As Decimal)

ravitejat
Level 2
I want to write a special procedure for excel that are not provided by the Excel VBO. When I try to write GetWorksheet() function in my object, I get this error - ""GetWorkshet is not declared. It may be inaccessible due to its protection level."" But when I try to do the same by adding a code stage in a new page of the Excel VBO, it works fine. What is the problem when using it in my object?

JanPiwowarski
Level 4
The GetWorksheetFunction is declared in the ExcelVBO. Look at the Initialise Page to the Properties of the Frame MSExcelVBO. Here you find the GlobalCode with all declared Functions. Copy the necessary Functions to your Object an if necessary the NamespaceImports under CodeOptions to your own Object.

ravitejat
Level 2
Got it. Thanks.

ravitejat
Level 2
Where does blueprism take external references(.dll files) for the excel vbo from?

KirankumarMahan
Level 4
Hi Raviteja, Go to business object(which you want to write code stage)-> Go to initial page -> object description box double click it -> go to code options-> you can add external dll here. try it

Anonymous
Not applicable
Hello, I tried to execute below code in BP -Object Studio. public int Calculate(int a, int b) { return a + b; } But I am getting an error. Compiler error at line 0:} expected. Kindly give me the solution.

Anonymous
Not applicable
Hi Kiran I have tried above mentioned option. But it is not working. Getting dll reference error. Even after give referecne of DLL. Internal : Could not execute code stage because exception thrown by code stage: Could not load file or assembly 'WebApiInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.