A scheme is proposed for generating W-type entangled states for atoms via adiabatic passage.The proposal is robust to atomic spontaneous emission noise.The scheme can also be used to generate the W states for cavities.The success probability is approximate 1.0.