Export (0) Print
Expand All

Finally (Visual Basic) 

Introduces a statement block to be run before exiting a Try structure.

Each Try structure must include either a Finally block or at least one Catch block.

NoteNote

Control does not pass from a Try or Catch block to the corresponding Finally block in the following cases:

When to Use Finally

If you have one or more statements that must run before you exit the Try structure, use a Finally block. Control passes to the Finally block just before it passes out of the Try structure. This is true even if an exception occurs anywhere inside the Try structure.

The Finally keyword can be used in this context:

Try...Catch...Finally Statement (Visual Basic)

Community Additions

ADD
Show:
© 2014 Microsoft