Hello
Is there any way to help someone migrate a VBA script to a UiPath project?
Not talking about using launch macro activity
Just switch solutions more easily tha having to redevelop eahc activity
Thanks for any input
Hello
Is there any way to help someone migrate a VBA script to a UiPath project?
Not talking about using launch macro activity
Just switch solutions more easily tha having to redevelop eahc activity
Thanks for any input
I very much doubt it. UiPath workflows are written in a very specific ‘language’, that appear outside as .xaml files.
You can execute VBA in a UiPath workflow, but this comes with a warning, namely UiPath does not have the capability to handle an unhandled exceptions that VB scripts running in Excel may throw. The UiPath workflow will be waiting for the VB error page to be closed to allow the script to continue. I had to write a separate workflow that was always executed in parallel to the VB, that checked periodically to see if the VB error page was displayed and if so, capture the message and close the window. The workflow would then throw an SE with that message.
Hi @adext01
I think your suggestion is hard to achieve.
Open whatever vibe coding agent you use, ask it to convert the vb script to c#.
Create a new UiPath project, use coded workflow and paste the c# code in.
test. Done.
It’s year 2026 now.
Hey,@Yu_Wang,
Let me ask you a question.
When you say to use a coded workflow, do you specifically mean using the Invoke Code activity?
No, invoke workflow.
Coded workflow and the xaml workflows are invoked in the same way. When you add an Invoke workflow activity, your .cs coded workflow will appear in the dropdown list, same as the rest of xaml workflows.
Is it possible to call a VB.NET code file?
If it is possible, please tell me the file name — is it .vb?
yes, but just bear in mind UiPath project can only be set to one, either VB.NET or C#, not both. My suggestion is to use C#.
to invoke your code, just use the class name directly, e.g. in xaml workflow, create a local vaiable of your custom type from your code in Assign Value, then use whatever method you defines. In coded workflow it’s even more straightforward.
in xaml workflow, if you can’t find your custom type, check the namespace panel. With old version of studio (e.g. before 2025.10.x) there might be namespace recognition problem if you changed your project’s name.
Hi,thank you for your reply.
Since I do not use C#, please tell me the file name of VB.NET— is it .vb?
Sorry, my appologies.
Yes VB.Net source code is with the .vb extension.
But UiPath Project only support including C# code as “Code Source File”. VB.net code is not supported.
So you either have to call invoke code and paste your vb.net code inside (very limited), or switch to C# code.
Here’s an example.
TestCodeSourceFile.zip (3.3 KB)
Unfortunately, it is useless you provide me C# code because I do not understand C#.
Like I said, UiPath project does not support VB.Net source code, so no point adding it in.
The only VB.Net support is inside the xaml workflow. You either put your code snippet inside the “Invoke Code” activity (which is clumsy and awkward and limited), or use it directly in things like “Assign” activity (for the latter, you need to select VB.Net as the language when you create the UiPath project.).
Yet anther way is, you create a separate VB.Net project (in Visual Studio or VS Code), create whatever classes you like, compile and build it into a DLL, then in your UiPath reference that DLL.
Again, my suggestion is to switch to C#, which is a lot more easier to work in UiPath.
And even conversion to native XAML may work.
I asked Claude Code to prepare simple “hello world” workflow and it worked ![]()
Cheers