Help with VBA code that is crashing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a fully automated model of a machine that the company I work for makes. I have 8 different rules running in the main model assembly file to change everything about the machine, such as components for different styles and overall machine material. There is one rule that has lines of VBA in it--this code changes the material of the nuts, bolts, and washers in the machine. I'm at the point where I'm creating drawing sets for this machine now. However, every time I finish creating one set, I have to go back to the main model and run component switching codes so I can make a new drawing set. But when I go to do this, I find that an error appears and the machine cannot run its component change codes. I've pinpointed the rule and the exact spot in it where the problem happens.
The first image I've attached is the rule with the VBA code in it, the second image is the error message.
The problem occurs in the code where I have a "MesageBox.Show" line tabbed out. There is only one other person in this company that knows anything about advanced Inventor use; I don't know as much as him, but he says that my problem is that the VBA in this rule is crashing and not allowing the model to complete its changes. The only solution he and I have so far is to restart the computer. It works, but I can't keep doing this every time I make a set of drawings. But until we can figure something out, it's all I can do.
This is a company computer, here are its specs: HP z210 Workstation, Intel Xeon CPU E31240 @ 3.30 GHz, 8 GB RAM, 64-bit operating system, running on Windows 7 Professional. I'm using Inventor 2016. All my Inventor files and its templates are stored on the company's server. I'm getting ready to request a better computer, because this model is only the smallest machine this company makes. The next machines I work on are going to generate much bigger and more complex models. I'm hoping someone can examine my problem and help me figure out what the problem is, where it's code or computer hardware related. But if anyone could maybe help me out here, I would greatly appreciate it. Thank you