Tips on maintenance of VBA code

♦ Take care when making any changes to existing software. Document clearly why, when and where changes were made, so that some sort of trace back can be made in the event of problems.

♦ Use the debugging facilities that w ere discussed earlier in this chapter to step through the code with the debugger, put in watches, breakpoints, and so on, so that you can ascertain what is happening. This can also help prevent crashes due to infinite loops, and so on.

♦ Do not eliminate program code unless you are sure that it isn't used! You might find that you may need it again at some later date. ' Comment out' lines of code that you think might be required rather than delete them. That way, you can always retrieve it in the future if required.

♦ Insert error checking where possible. Remember, the fallibility of human nature - if something can go wrong, it will!

0 0

Post a comment