Make sure I have this correct...It run's great from your local desktop where you put it together, but if you deploy it to the SQL Server and run it under what I am assuming is the agent it's failing? If so you should read the KB below.
The SQL Agent needs to own the package to run it.
http://support.microsoft.com/kb/918760