I believe the correct term for a class to have enough students to be worth teaching is "to make." If the class officially didn't make, you should get a refund of course: the school decided the course doesn't even exist and can hardly make you pay. In this case, the school would not allow the professor to submit a grade, so it's out of their control. The prof could decide to teach you anyway but they couldn't submit a grade for it as the class simply doesn't exist.
If the course did make but your prof is literally refusing to do their job (this happens thanks to tenure) then you have a tricky position: even when tenured professors refuse to hold class or office hours or unfairly fail all their students (there have been cases of this) it can be contractually almost impossible for the school to remedy. From the school's perspective there is a class and your prof will eventually enter a grade for it, or not (which also happens). You'll eventually have credit hours for it at that school, even if the class isn't meeting. The prof might be penalized, but since you would be getting credit hours the school may not wish to refund. In this case what can you do?
If you want the teaching then you're out of luck. Prof says he won't teach. (Though idea: if the same course is offered at a different time perhaps you could just switch sections? You shouldn't have to, but just an idea. Maybe the second prof can't grade your assignments, which is a PITA for them, but lets you listen to lectures at least, which shouldn't put them out.)
If you want the class knowledge and don't need the actual weekly teaching part, perhaps you could self-study and the prof would administer tests for you at mutual convenience? That should be minimal effort for the prof and they might be amenable. If you additionally need some tutelage perhaps this could be available in office hours?
If you want the class credit and don't care about the knowledge you might be able to just get an auto-A or pass from the prof on just a verbal commitment to study the text.