How many working keys do you have? If you have two working keys then you can program the other key(s) with them. Just insert the first key, turn forward but don't start, watch the anti-theft light and when it goes off take that key out and insert the second good key and repeat, when the anti-theft light goes out insert the non-working key and turn it forward, wait about six to eight seconds then remove the key, reinsert and try to start the car. It should start ok with the previously unprogrammed key. If it doesn't then don't keep retrying it as the security will kick in and lock all the keys out for a while.
If you only have one working key then it will need to be programmed at the dealer.
Hopefully that will save you a trip.
2010 F150 XLT SuperCrew 5.4 4x4
Royal Red w/stone interior
Mama's truck!
2003 Ford Crown Victoria LX Sport the Crown Rauder
Silver Frost w/charcoal interior
Modded a little