Generally speaking if an action provokes an AoO it cannot be used as an AoO so charging, ranged weapons etc. do not allow AoO.
What AoO represents is your character taking a swing at something that runs by. You take a penalty when using a ranged weapon on melee so therefor you are better off letting the creature run by and shot at the one you're already aiming at.
Another point is that an AoO is an extra attack, since ranged weapons must be reloaded you cannot take an AoO with them becuase you still have to reload and therefor cannot make an extra attack with them.