Hi Sonny,
i do not waste any time with VBA in Inventor.
I have a large app inside Inventor (also C++ dll) and i do anything inside the dll.
Define commands, create ribbon buttons and tabs, do user interaction, do anything...
I strongly recommend you to avoid the VBA crap inside Inventor - it is in no way a must.
Most times VBA is quick and dirty.
I rarely use it for some short tests, but would not implement any production function in VBA.
But, i also have to deal with other products, where the native dll approach wont work as in Inventor.
Here's an example of a VBA module to access a remote dll in a very famous big CAD system 🙂
Hopefully it would work in Inventor also.
In the first line of your module, prior to any function declarations you have to place lines like this one
'
Private Declare PtrSafe Sub myfuncCallvba Lib "D:\\yourappdir\\your.dll" ()
'
You probably can omit the PtrSafe keyword
And it would be helpful to have yourappdir somewhere Inventor can find it.
A call to the declared funtion looks like this:
Call myfuncCallvba
Arguments (if you need) should work also, at least if you use standard types.
In my case i have a set of registry keys and variables where i place the argument values before calling the dll functions.
Hope that can help you.
Regards,
RIchard