# Invoke code activity VB.Net example

**URL:** <https://forum.uipath.com/t/invoke-code-activity-vb-net-example/10903>\
**Category:** Academy Feedback\
**Tags:** studio, system, activities\
**Created:** [September 1, 2017, 9:28am UTC](https://forum.uipath.com/t/invoke-code-activity-vb-net-example/10903 "2017-09-01T09:28:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![beesheep](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/beesheep/32/621_2.png) [@beesheep](https://forum.uipath.com/u/beesheep)\
**Post date:** [September 1, 2017, 3:09pm UTC](https://forum.uipath.com/t/invoke-code-activity-vb-net-example/10903/2 "2017-09-01T15:09:22Z")

</div>

Ok…

first:

You can reffer to methods available in the .NET library, the imports are done using UiPath.

second:

> **[Automate Excel from Visual Basic .NET to fill or obtain data by using arrays...](https://learn.microsoft.com/en-US/previous-versions/office/troubleshoot/office-developer/automate-excel-from-visual-basic-net)**
>
> Demonstrates how to automate Microsoft Excel and how to fill a multi-cell range with an array of values. Also illustrates how to retrieve a multi-cell range as an array by using automation.

I am quoting @andrzej.kniola here "Personally I just use it solely for void methods and from useability perspective " even this is related to invoke methods I think **you don’t need to reinvent the wheel here**.

> [@InvokeCode Example](https://forum.uipath.com/t/invokecode-example/9311/3):
>
> Hi, The official training materials might not be up to date yet as this activity has only just been added to the Community edition. I can give a small example right here though. Just as with “Invoke Workflow”, you can specify arguments that will be accessible inside: [arguments] But instead of a workflow filename you enter Visual Basic code you want to execute, directly into an editor window. Suppose I want my code activity to randomly shuffle its string argument. I could program this as foll…

> [@Display Form through UIPath](https://forum.uipath.com/t/display-form-through-uipath/6411/3):
>
> Hi Richard, This would be that way in [VB.Net](http://VB.Net) Dim frm As New System.Windows.forms.form Dim bar As ProgressBar = New ProgressBar() bar.Location = New System.Drawing.Point(50, 20) bar.Name = “progressBar1” bar.Size = New System.Drawing.Size(171, 23) bar.TabIndex = 0 bar.Style = ProgressBarStyle.Marquee bar.Minimum = 0 bar.Maximum = 100 frm.Controls.Add(bar) frm.Show() Importing System.windows.Forms first is required, note also that you will get no intelisense from it inside the code …

> [@Create multiple field input dialog](https://forum.uipath.com/t/create-multiple-field-input-dialog/7725/6):
>
> Probably, this seems to be quite a popular request that keeps coming back. In the meantime (and since I can’t sleep for w/e reason frowning ) here’s a base to expand upon and customize for your needs: 
> 
> > **Messy code inside**
> >
> > using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Activities; namespace WebHelpers.InputHelpers { public sealed class MultiDialogActivity : CodeActivity { [RequiredArgument] public InArgument\<…

---

_[View the full topic](https://forum.uipath.com/t/invoke-code-activity-vb-net-example/10903)._
