ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
CACad Admin28/03/2017

I have a macro that i have used for some time.  No issues.  I wanted to make some updated to it.  I open the macro, WITHOUT making any change VBA Runtime Error '9', Subscript out of range error.  I don't get the error or crash if i just use the macro.

The function throwing the code (stops on the BOLD line):

Private Sub PopulateDrawingList()

   For i = 0 To UBound(2DDRAWINGS)

      tmpstr = ""

      If ChKB_Pre Then

        j = CInt(Left(PARENTLIST(i), 1))

        For k = 2 To j

          tmpstr = tmpstr & ".  "

        Next

      End If

      Lb.AddItem (tmpstr & 2DDRAWINGS(i))

    Next

End Sub

Any Thoughts....