Hello Joakim,
If you check your oUDO1 object you will see that it doesn't have any Show() method unlike user forms. And if you try oUDO1 .Show() you don't see any syntax error but it throws the exception you shared. Therefore I was always using the above method to add my UDO Form to the main menu.
I am not sure if there is another method to initialize UDO Form but you can use below method to open the form.
try
{
if (pVal.BeforeAction && pVal.MenuUID == "SBOAddonProject1.Form1")
{
Form1 activeForm = new Form1();
activeForm.Show();
}
else if (pVal.BeforeAction && pVal.MenuUID == "SBOAddonProject1.UDOForm1")
{
Application.SBO_Application.Menus.Item("UDONAME").Activate();
}
}
Thanks,
Atilla