Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21182

Most common word, code error "Run-time error '5': Invalid procedure call or argument"

$
0
0
Code:

Dim brojac1 As Integer
Dim myArray() As String
Dim x As Integer, y As Integer
Dim RijecPonavlja As String
myArray = Split(sadrzajB, " ")
For x = 0 To UBound(myArray)
If Asc(Right(myArray(x), 1)) > 64 And Asc(Right(myArray(x), 1)) < 123 Then
Else
myArray(x) = Mid(myArray(x), 1, Len(myArray(x)) - 1)
End If
Next x
For x = 0 To UBound(myArray) - 1
    For y = x + 1 To UBound(myArray)
    If myArray(x) = myArray(y) Then
   
      RijecPonavlja = (myArray(x))
      y = y + 1
      End If
    Next y
Next x

Program without above code work perfect, but with this part i have problem.
"Run-time error '5': Invalid procedure call or argument"
Its work with a small word (doc) document, but when i try to load a big document its show this error, i deleted this part and its work normalny. Thank you !

Viewing all articles
Browse latest Browse all 21182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>