"Object variable or With block variable not set"

You haven't set something in the line that gives the error. In this case, you have not defined the slide. You must have taken out the slide definition when you inserted RangeName = "PPTSlide".