I have the following code in Visual Studio 2005.
Dim OutFile As System.IO.StreamWriter Try OutFile = New System.IO.StreamWriter(Filename)
Its a question of scope, the initialisation of the outfile object is happening in a block of code not visible to the fianlly block.