How to use Message Box or MsgBox inside 'invoke code'? Getting error

I stripped the code to barebones for testing and tried many variations. Finally, this works:

System.Windows.MessageBox.Show("hello")

I couldn’t get MsgBox to work on its own. I imported system.windows.forms and that didn’t work. MessageBox is “ambiguous” in a couple of imports, so the full namespace as in code above seems to be needed. This is my first foray into UiPath invoke code. I hope it’s not always this hard to get something so simple to work.

1 Like