I've been tasked with adding features to a database that I recently inherited from another company. The reason I'm taking over is because that company has been "relieved" by our customer. Once I opened this file for the first time, let's just say it didn't take me 2 minutes to start forming the picture of why they were relieved. This database is....sub-par.
This file at least 50 modules and 200 subs/functions (conservative estimate), and none of them have Option Explicits, Dim statements, or Error Handlers (no wonder they reported so many reliability issues). I understand how to fix this for each individual module, but it would be extremely tedious and time-consuming to do this by hand for every single module.
Is there a quicker way to automate this process (or at least some of it)? Is it possible for VBA to make changes programmatically to other sections of VBA code in other subs/modules?
I checked the box under Tools -> Options to require variable declaration, and it solves the Option Explicit problem for new modules, but it doesn't appear to apply that change retroactively to pre-existing modules.
Does this make sense? Are these valid questions/criticisms, or am I way off the mark? Thanks!
This file at least 50 modules and 200 subs/functions (conservative estimate), and none of them have Option Explicits, Dim statements, or Error Handlers (no wonder they reported so many reliability issues). I understand how to fix this for each individual module, but it would be extremely tedious and time-consuming to do this by hand for every single module.
Is there a quicker way to automate this process (or at least some of it)? Is it possible for VBA to make changes programmatically to other sections of VBA code in other subs/modules?
I checked the box under Tools -> Options to require variable declaration, and it solves the Option Explicit problem for new modules, but it doesn't appear to apply that change retroactively to pre-existing modules.
Does this make sense? Are these valid questions/criticisms, or am I way off the mark? Thanks!