I committed sexual sin after going to the temple. I know I have to confess to my bishop. The question I have is this, how many people have to know if I am excommunicated? I had a friend that was excommunicated and she told no one but most of the ward found out any way. She actually made a point of not telling anyone but someone talked. Who gets to know this? How many people need to know my status?
It is good that you recognize the need to talk to your bishop about your serious transgression of your temple convenants. Your bishop is there to help you step through the process. He is also there to judge your willingness to humbly and sincerely repent and work your way back to God. Sometimes this requires excommunication so that the sinner can have a chance for a fresh start and to work their way back.
When someone gets excommunicated, limited information must be passed to the various leaders, so that they know that the person can no longer perform basic functions in the church, and should not be called upon to do so. None of the details should ever be given out. Still the leaders are human and they can make mistakes and fellow members can be very perceptive and fall into gossip. Their weakness should not be used as an excuse for you to avoid the repentance process.
Personally, I view a person who has been excommunicated and still attending church as positive. I know that if they stay on course and continue meeting with their Bishop and work out their repentance, they stand a better chance to not only have a stronger moral backbone, but to also come back as a stronger member of the church and a better disciple of Christ. Having said that, you need to keep your focus on the atonement and work out your repentance. That is much more important than what those around you think.