Error Handling
Exercise 7.01
Exercise 7.01
The aim of this exercise is to prevent a run-time error message when the user cancels an input box.
Files Needed
Click here to download the file needed for this exercise.
Instructions
- Extract and open the Movie Picker.xlsm workbook. Click the Pick Best Film button on the worksheet:

You can click the Pick Best Film or Pick Worst Film button to choose a film from the list.
- If you click Cancel on the input box which appears, you'll receive a run-time error message:

Clicking Cancel will cause a run-time error.
- Identify the line which caused the run-time error in the Pick_Best_Film subroutine.

Identify the offending line.
- Add an On Error statement which will cause the subroutine to exit if the user cancels the input box.
- Create a similar error handling system in the Pick_Worst_Film subroutine.
- Test that your error handling system works.
- Save and close the workbook.
Answer Files
Click here to download a file containing a suggested answer.
This page has 0 threads
Add post