I didn't realize that SUB()s had size limits on them.
A few days ago Excel informed me that the length of my main sub was too long, so I decided to split a section of my macro out into a new sub, then call it when I needed it.
I am now having ALL sorts of problems, and I can't figure out why.
In what used to be my only SUB(), I get to a place in the code where I call this new sub that I have moved the remainder of my code to. I've placed stops before and after the call for debugging purposes.
Once it hits this, it goes into this new sub and performs actions. However, it gets to a certain line, then just quits back to the main sub.
There is nothing wrong with this last line, but once it hits this, it goes back into the MAIN sub back to the stop directly AFTER teamsettings
and I can't figure out why! If I F8 through the code and bypass this line, a little bit later I get to the following line:
which is supposed to call up the IBM 3270 Terminal, which also worked perfectly before, and that juts kicks me out of the sub back to the line in the main sub where I called this from.
Putting different pieces of code into different subs is somewhat new to me. Is there something I'm not doing correctly? I found that there were certain variables which I had declared in the first sub which were no longer working once I moved into teamsettings(), so I made those Public variables up at the top, (e.g.)
But apart from that that's the only change I've made. Can someone help me understand what I've done wrong to screw this up?
Thanks!
Bookmarks