In VBA, you can use a line continuation character (a space followed by an underscore) to split a single VBA line into two or more. Like this:
I just tried to make a really long constant string and I separated it into it’s 35 or so lines so that it would be readable. Lo and behold, at line continuation character number 25, I got an error: Too many line continuation characters.
I know I use too many line continuations. I’m a product of the newsgroups where it behooves you to not post code whose lines exceed 76 characters. Even when I code and have no intention of posting on a newsgroup, I still find myself keeping the lines short. Well, this is the first time I’ve ever run into a limit. By the way, I fixed it by:
sString = sString & “has fleas.”
One final note about error messages: This limit may be hard and fast, or it may be one of those “available memory” type limits. I don’t know and a rudimentary Google search didn’t tell me. (See footnote 1). Microsoft’s error message certainly could of told me though. How about a message like “Too many line continuation characters. They are limited by available memory.” or “Too many line continuation characters. You can only have 25.” or “Too many line continuation characters. Why don’t you learn how to code properly, you twit.”
FN1: I was going to tell this really boring story about why I’m using a computer that doesn’t have much RAM, but I think I’ll just make a really boring separate post instead.