First of All thanks a lot for the code. But I had one problem opening file with 'wb' attribute I had to change it to 'w' only Thanks