Message 1 of 6
VBA - ActiveDocument.Close causing Inventor crash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm creating a macro to run on creation of a new assembly from a particular template. I've read the help files and created a macro named autonew in the template's VBA project file. It works great except for one thing: if the user presses "Cancel" on my form, I want to not only unload the form but also close the file. For this case I've used:
ThisApplication.ActiveDocument.Close True
I've created a test template assembly with only this line in autonew, and it crashes Inventor. The same line of code an a non-autonew module within the template file's VBA project closes the document without error or crashing. I assume this is a bug and not as designed.
Is this a bad way to accomplish the task of closing a newly created assembly? Even if this isn't the preferred approach, I don't think this should cause a crash.
I'm running Inventor 2009 SP1.
Edit: I neglected to mention I'm running 64 bit on XP64 Edited by: alewer on Apr 22, 2009 10:15 AM
ThisApplication.ActiveDocument.Close True
I've created a test template assembly with only this line in autonew, and it crashes Inventor. The same line of code an a non-autonew module within the template file's VBA project closes the document without error or crashing. I assume this is a bug and not as designed.
Is this a bad way to accomplish the task of closing a newly created assembly? Even if this isn't the preferred approach, I don't think this should cause a crash.
I'm running Inventor 2009 SP1.
Edit: I neglected to mention I'm running 64 bit on XP64 Edited by: alewer on Apr 22, 2009 10:15 AM