Invoke Code, instr() and mid()

I have some fairly sophisticated Classic ASP (so effectively vbscript) code that I would like to use in UiPath.
I’m planning to use Invoke Code and have created a test harness to call the code.
It all works perfectly
However, when I copy this into my project, it fails at runtime with Errors BC30451 for every instr and mid call the code uses.
My understanding is that instr and mid, whilst being vbs functions are supported by .net and this seems to be proved in my test rig.
Am I missing a package in my development environment?


Indeed, InStr and Mid work fine in InvokeCode. Maybe you should declare some arguments? (or simply have to declare some variables if they stay local)

Thanks for your interest and confirming that it should work. My issue is that it works in UiPath studio in one project, but throws the errors in another project.

Did you check the arguments passed to the InvokeCode activity? When I began using the InvokeCode, I’ve got plenty of BC30451 for that reason.

Hi Again,

I really appreciate your interest and help.

I’ve re-written the code to replace all the instr() with .indexof and all the mid() with .substring (so basically converted it to .net and it works fine now.

The annoying thing is that it worked just great as it was in my test harness.
It feels like there is a package that I have installed with my test project that handles these functions, but I don’t have it in my main project.

Thanks again,

1 Like