Hi, Can anyone suggest why the following code behaves as it does. When run for the first time i get an 'Out of Stack Space' error. If i End the code and run it again any number of times thereafter it runs okay! Any ideas plus possible solutions to rectify would be most appreciated. I am running the code using Excel 97.
Sub test()
Dim abc as String, pos as Long
abc = Space(260000) & " vba vba vba"
pos = InStr(1, abc, "vba", 1)
End Sub
PS. abc would usually be a string read from a text file of similar length. Spaces used here just to replicate the error.
Sub test()
Dim abc as String, pos as Long
abc = Space(260000) & " vba vba vba"
pos = InStr(1, abc, "vba", 1)
End Sub
PS. abc would usually be a string read from a text file of similar length. Spaces used here just to replicate the error.