• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Using Procedures > Implementing Error Handling

Implementing Error Handling

There’s a potential problem with the procedure that you just saw: because it uses integers for both input and output, it’s possible for it to calculate a value greater than an integer will hold. For example, Figure 4.6 shows the result of trying to call Procedure22 with an input value of 20,000. Because this calculates an output value of 200,000, which is larger than an Integer variable can hold, a VBA overflow error occurs.

Figure 4.6. A procedure with an overflow error.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint