For reasons too annoying to go into, I'm having to convert some code from an original library written in c# to one written in vb.net. I've used an automatic code converter and whilst it compiles, I'm getting an error at run time on one particular line: