Hi, Ritu,
When you run everything in one shot I assume it works. When you step through the code and you might closed your calculator and then opened it manually that would cause message "Not Connected" as you need to attach to the application.
Regards,
------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/Europe/Prague
------------------------------