Is there a way to import a vb module into the VBA editor through the API?
I can add a new module with the command
InventorVBAComponents.Add()
But this adds an empty module. Is there a way I can populate this module from a text file? Or better yet, simply importing a .bas file into the VBA editor?
Solved! Go to Solution.
Solved by GeorgK. Go to Solution.
Although the code wasn't transferable between excel and Inventor, it put me on the right path. I was able to find the import command through the "VBProject" container (although it was tough because Intellisence didn't acknowledge it existed, but it still works)
For the record this is the snippet that I am currently using
Dim oP As InventorVBAProject For Each oP In _invApp.VBAProjects If oP.Name = "ApplicationProject" Then
op.VBProject.vbcomponents.import("VBACode Location") exit for end If Next
Can't find what you're looking for? Ask the community or share your knowledge.