The Private Life of Sherlock Holmes (1970, IMDb), directed by Billy Wilder was, according to some accounts, almost a portrayal of a gay Sherlock Holmes. However the director's plans were thwarted by censors.
Wilder is quoted as saying: "I should have been more daring. I have this theory. I wanted to have Holmes homosexual and not admitting it to anyone, including maybe even himself. The burden of keeping it secret was the reason he toke dope." (1970, in Gemunden 2008)
In the final movie the closest Holmes comes is claiming to be gay to evade an request by Russian ballerina Madame Petrova that he father a child for her. Robert Stephens plays Sherlock Holmes and Colin Blakely is Dr.Watson--after the failure of initial plans to cast Peter O'Toole and Peter Sellers.
While The Private Life of Sherlock Holmes is an interesting and fairly good movie, it is a greatly watered down version of Wilder's initial concept for a three hour movies including four stories, rather than the 125 minute two story version that was released.