- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, fellows,
My issue this time is:
How can I run a VBA macro after Save my Opened Document?
I mean, How can I run a VBA macro when I'm saving an Opened Document?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
As mentioned above use an event trigger to run an iLogic rule which then runs a macro.
InventorVb.RunMacro("ApplicationProject", ModuleName, MacroName)
The first item doesn't necessarily have to be the application project if the macro is within the part.
Regards Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok! I got there.
I have many files, so I need a way to run the rule
InventorVb.RunMacro("ApplicationProject", ModuleName, MacroName)
with the event trigger "Run this rule - After Save Document" automatically, with no need to do the same task to each file. I say this also because of the other users of our net, that they don't need to remember the task.
I would like to get the Event Trigger automatically too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Try search "Code Injector" in the forum, which can be used to set event triggers for lots of files in batch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
In the long term it can be a real problem keeping track of which document is running what code and modify any of them if necessary - e.g. to change the logic in it. The best would be to go with addin's as pointed out here:
http://modthemachine.typepad.com/my_weblog/2008/09/vba-document-projects.html
Cheers,

Adam Nagy
Autodesk Platform Services