This question is probably too general, but can somebody give me an idea of what would cause me to get a

Runtime error 5: Invalid procedure call or argument?

The debugger is highlighting this line of code:
sFileName = Mid$(txtNames.Text, charOffset + 1, LineLength)

Thanks to anybody that answers