Hi @isocam. That looks a lot like the VBA example I shared with you the other day, that has been mostly converted to vb.net. The first think I see here that might be a problem is that you have 'declared' the variable that should represent the Inventor application, but you have not 'set' its value yet. The line of code that tries to open the document will not work, because the 'Myinv' variable has no value. Also, in true vb.net, you usually want to keep your code as strict as possible. What I mean is, 'declare' every variable, and its Type ahead of time (early binding), unless you either do not know what its Type will be, or its Type may vary. Another side note that may be important is how you are closing, or disposing of the part you are opening. When we open a document visibly (not hidden), then you will always want to use the regular Document.Close method. But when you open it invisibly (hidden), and that document is not currently being referenced by any other assemblies or drawings (or derived into any parts), then we can just use the ReleaseReference method. After that point, the next time the system closes unreferenced documents, it will dispose of what is was holding in session memory for that document too. The CloseAll(True) method is sort of a 'clean up' tool, often used in 'batch' processing to help improve memory usage & performance, but it may not always be ideal to use in every situation. When you read the documentation for that method, it says that you may loose any unsaved changes to those documents it will be closing, without any prompt about those changes. So, in a one-off situation, just using the ReleaseReference method is likely good enough, and would likely be safer.
Documents.CloseAll
PS. You do not need to use the 'Call' keyword in vb.net, like we did in VBA. Plus, even though the MsgBox method was the most common to use in VBA, the MessageBox.Show method is now better to use in vb.net. It seems like I read somewhere that the newer MessageBox.Show method actually uses the MsgBox tool somewhere internally within its definition block of code though.
PPS. You may also need to add a reference to "Autodesk.Inventor.Interop.dll", not sure. I do not use Visual Studio a lot, but I'm pretty sure a lot of that stuff is done quite a bit differently there than it is in iLogic rules.
Wesley Crihfield

(Not an Autodesk Employee)