Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is it possible to call a vba module from a global ilogic form? If so, could someone please give an example?
Thanks!
Solved! Go to Solution.
Is it possible to call a vba module from a global ilogic form? If so, could someone please give an example?
Thanks!
Solved! Go to Solution.
Hey @cmines,
It is possible. Here are steps:
1. Launch inventor, create a module named as "TestM" in ApplicationProject level, with a subroutine "test1"
Sub test1()
MsgBox "test"
End Sub
2. Create a rule, global or not as needed, with following code:
Version:1.0 StartHTML:00000145 EndHTML:00000615 StartFragment:00000294 EndFragment:00000583 StartSelection:00000294 EndSelection:00000294SyntaxEditor Code Snippet
InventorVb.RunMacro("Applicationproject", "TestM", "Test1")
3. Create a global form, drag the rule into the form.

Hi @JaneFan,
I tried this code with nothing else in the rule and I got "syntax error" for every line. I apologize if I just missed a basic step, but I am not a programmer. Tried with code exactly as you posted as well as a couple other unsuccessful versions. What am I missing?
Thanks again for your help!
Hi @JaneFan,
One other thing.... when I keyed the code exactly as you have it, I did get a different error. I got "Unit name "StartHTML" is not valid in Inventor. Also got that error message for EndHTML, StartFragment, and EndFragment.
Thanks again!
Hey @cmines,
In iLogic rule, please only add this line:
InventorVb.RunMacro("Applicationproject", "TestM", "Test1")
The description "Version:1.0 StartHTML:00000145......" is invalid lines.
