See if this works for you

It should either close if there is only one presentation or close the active one leaving others open

Sub quit()
ActivePresentation.SlideShowWindow.View.Exit
ActivePresentation.Windows(1).Close
End Sub