A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
There are a few possible things that could be happening.
(1) Go to the Slide Show menu and choose Set Up Show. Look under slides to see if it is set to show all slides or some subset of slides.
(2) Check to see if slides 6-40 are hidden. Go to slide 6 and look in the Slide Show menu to see if Hide Slide is checked.
(3) When you say it "ends(?)," what exactly do you mean? Do you have automatic timings set and they stop working, or when you manually try to advance the slides, the slide show exits? If it is the latter, your problem is probably 1 or 2. If it is the former, you might have some kind of sound or animation on slide 5 that is hanging up.