If the excommunication is valid, it is due to being in a mortal sin to which the code of canon law attaches the censure of excommunication - which is why such a person cannot receive the Holy Eucharist or Confirmation etc,. Excommunication also means that the person cannot be a Godparent, or an usher, or in the choir, etc., iow, he is prohibited from participating in the community of faithful, yet the person still has all the obligations of a Catholic, but none of the privileges.
I could be wrong but I don't think it's possible for anyone to get excommunicated for a venial sin.
In short, if the censure is valid and the person dies unrepentant, he is lost forever.