Random Compile Error

Random Compile Error

Anonymous
Not applicable
470 Views
5 Replies
Message 1 of 6

Random Compile Error

Anonymous
Not applicable

Since yesterday we've been getting occurances of this (and other) errors. I haven't been able to track down the source but I'm thinking that it's to do with the latest win7 updates. What's not shown in the screen shot is that DocumentType is highlighted in the 8th line of code. Prior to this we were getting an Error highlighting ThisApplication in the 4th line. The strange thing is that this works on one machine but not another, a couple of restarts later and maybe they both work, later yet and maybe the errors switch machines, totally random from what I can see. This makes me think that it's Windows based and not VBA based but I'm relatively inexperienced when it comes to error tracking (and code writing for that matter). Maybe one of you super code jockeys could take a look and give me some hints on where to look next. BTW, this module has been in operation for the last two years without issue although in an effort to find the problem I did clean up the module importation/insertion section this morning.

 

I've included the entire Module in .txt format.

0 Likes
471 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

It appears to be branching out to other formerly working modules.

0 Likes
Message 3 of 6

Anonymous
Not applicable

Network issues could account for the problem.  If your running code cannot open a network based file then things could go wonky.

 

I will also mention that VB6 programs have to be upgraded when you switch from one version of inventor to a newer one.

Really odd code errors (Not unlike you received) can occur.  I made some notes on the topic once.  Let me dig around in my files....

0 Likes
Message 4 of 6

Anonymous
Not applicable

Found it.  Unfortunately it was refering to Solidworks VBA.  However I would not discount the same thing happening to Inventor VBA.  It amounted to VBA hanging onto the previous API version reference.   Here is the summation of my notes.

------

 

When opening a macro that was saved under a previous version you will find that the reference to:  "Sldworks <Version> Type Library" is prefixed with "Missing: "

 

To repair the problem:

1) Uncheck the offending reference.

2) Save the Macro and close the VBA environment within Solidworks.

3) Close Solidworks.

4) Open Solidworks

5) Open the Macro for Editing

6) The reference should be corrected.  If not find the reference in the list and check it.

7) Save the macro so that the references are saved.

0 Likes
Message 5 of 6

Anonymous
Not applicable

Thanks for the insights. We haven't upgraded versions in a few years so I don't think it's a compatibility issue. If I can isolate the users having issues I may be able to find the network issues though.

 

Thanks,

 

Eric

0 Likes
Message 6 of 6

Anonymous
Not applicable

I will have the users experiencing problems download the default.ivb and run from their c drives, if the problem persists it is not a network issue, if the problem evaporates, it is.

0 Likes