Sorry to say this, but sloppy coding to start with

Or more accurately, your programmers haven't kept up with the software, as each revision of the development system would encourage more strict programming in an attempt to produce (hopefully) more robust code at the end. Older versions of the software allowed more sloppy, "quick and dirty" coding, as they were simpler systems. As high level languages move further and further away from low level, it makes more sense to build in safety.
I know how you feel - I have a couple of medium sized VB6 apps that run my brothers shops. VB6 is old school language - brilliant in its day for fast development, but way, way , way past its sell-by date. Actually out of support. All the other old apps I had rewritten or converted to new languages, but had entirely forgotten about these 2 until about a year ago when he wanted some mods done

I ran an import into .NET - one had 1600 issues I needed to resolve (most fairly simple stuff), but the pos one, no way Jose, the importer could make head nor tail of some of my direct hardware control. *sigh*
So for now, dug out my old VB6 CDs, and been relearning that all year to make some mods he needs in before the Christmas rush (ie RIGHT NOW!), whilst at the time, gradually making the code more friendly to the .NET converter. I may still end up rewriting it from scratch anyway