Thanks a million mikerickson, I you code is working, can you know How can I use it in Autoit script to achieve same functionality not through the VBA but through the Autoit script.