Error Message - Type Mismatch
Error Message - Type Mismatch
(OP)
I am running Visual Basic Code that loads into an assembly 2 parts, rotates into positon then does a cavity over 30 iterations.
I am getting a new error - type mismatch on the line
Set myFace = myFaces(0)
this is a line within a For loop that loops through the 30 iterations, and the error happens not the first time through the loop but about the 8th time through the loop.
I am trying to select the body before rotating it. I use this technique because I dont always know what the last feature is in the tree, so I use this technique to automatically find it for me.
Why would it fail only after multiple iterations? The Dim statement that I have is as follows:
Dim myFaces As Variant
I have used the coding from the Solidworks 2007 API help file, even though I am running SW2009. SW2009 Help file for API sucks.
Any thoughts how to avoid the error?
I am getting a new error - type mismatch on the line
Set myFace = myFaces(0)
this is a line within a For loop that loops through the 30 iterations, and the error happens not the first time through the loop but about the 8th time through the loop.
I am trying to select the body before rotating it. I use this technique because I dont always know what the last feature is in the tree, so I use this technique to automatically find it for me.
Why would it fail only after multiple iterations? The Dim statement that I have is as follows:
Dim myFaces As Variant
I have used the coding from the Solidworks 2007 API help file, even though I am running SW2009. SW2009 Help file for API sucks.
Any thoughts how to avoid the error?






RE: Error Message - Type Mismatch
-handleman, CSWP (The new, easy test)