The code example above is from the VB6 version, I am still trying to get to grips with the try and catch method of handling exceptions.

I guess the method behind the madness is the same.