James Doohan made his final television appearance before his death on 20 July 2005, in the Season Four episode "Where No Duckman Has Gone Before" which originally aired on 23 August 1997.
Presumably due to rights clearance issues, the scene where Duckman sings "Mr. Tambourine Man" is cut from the Seasons 3 & 4 DVD set.