I don't understand why you are not getting sound when you use the optical cable from the cable box to the soundbar. That should work. Maybe the cable box has some setup control to tell it to send a signal out through the optical connection? (I have a foggy recollection that one of my cable boxes worked this way, a long time ago.)
If your TV is hooked to an antenna, as well as the cable box, you're not going to get sound from over-the-air channels through the soundbar if the soundbar is not connected to the TV.