Finishing Up
Control Arrays Control Arrays are sets of controls. Each one is subscripted, from 0 to n. That allows you to handle all of the controls together. 1. Copy the control Paste it Answer YES to the control array question.
Trapping Errors Private Sub BlahBlah() X=7/0 On Error Goto ErrHandler ‘More lines of code ErrHandler: X=0 If Err.Number = 11 then msgBox_ (“You tried to divide by 0!!) Exit Sub End Sub
Debugging
2 main types of errors Logic Errors – Something in the programming methodology Syntax Errors – Bad lines of code. These are usually caught at design time.
Debugging Debug.Print – Immediate Window Commenting out code Step into, etc. MsgBox(yourVariable) Breakpoints Stubs – running functions/subroutines only. Setting Watch Variables Step Into/Over/Out
Compiling/Distributing
Compiling makes the program Executable on other machines Speeds up execution, because the computer no longer has to compile the program each time. File / Make xxxxxx.exe Options – Generally Compile to native code and Optimize for fast code. Usually – Optimize for fast code.
Package and Deployment Wizard Get it from Add-Ins Helps determine fitting program on disk Helps to set up an installation program Helps to distribute over network Helps to distribute over internet Provides uninstall program