I am using the PutUserLayerGfx Method in my Microsoft Visual Basic 2010 program and I do not want the graphics to be attached to a component so I set the argument to Nothing. From the automation reference: The component (Component) to which this user layer graphics is added. Specify Nothing if the element is not part of a component. Note that, VBScript requires that you specify the object or Nothing as an argument.
When I run the script, I get a type mismatch error:
System.Runtime.InteropServices.COMException was unhandled
ErrorCode = -2147352571
Message=Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
Source = Microsoft.VisualBasic
It works fine if I attach it to a component object, but does not recognize "Nothing" as an argument.
VB.net is not the same as vbscript so you might be able to just omit entering anything since the default value is null for no component.