At the year 1893, Doyle was sick of Holmes. Some people say he was jealous that the character he made up was more famous than he was, and he claimed that he wanted to concentrate on more "serious" writings.
By the year 1902, people have boycotted all the writings of Doyle, and they even quit going to his clinic for counsels. He was about to declare his bankruptcy. And he was trying to write a story about a myth of an enormous dog haunting the life of people in some area of Britain. He wrote the story with some new characters, but finally found that writing it with Holmes as the hero would make much better, and it would be easier than making up some new environment for the characters. People were happy, but the problem was that the story takes place in a time interval before his acclaimed death in the "Memoirs of Sherlock Holmes."
He, then, is forced to resurrect Sherlock Holmes in the "Return of Sherlock Holmes," at the year 1905, which is a collection of 10 short stories. He, then, stops writing Holmes's stories, without killing Holmes, which was a clever move. But then people were at a rage and wanted some Holmes's adventures, and Doyle had to write something, but this was not any earlier than 1914, in "The Valley of Fear," 9 years after his last appearance.
In this book, he uses almost exactly the same method of writing he used in his first book, "A Study in Scarlet." That is, he cut the story into two parts, the first one featuring Holmes, and the second one does not mention Holmes at all accept at the very end of it. People did not like that because Holmes only appears at half of the story.
And let me tell you, that the first half, which features Holmes, was not all that insightful. It was not all that clever. It was the second part that appealed to me. It was a very nice plot.