Visited by James, Duke of York, and "several high personages"
On October 13th 1679, Leeuwenhoek wrote to Hooke (AB 51):
His Highness the Duke of York honoured me a few days before his departure from this country by a visit, accompanied by several high personages. He wished to see my simple observations and so I showed His Highness among other things, the little animals in the male sperm of a dog through an ordinary microscope. His Highness admitted that he not only saw that they lived, but that he even could clearly distinguish their tails.
On 6 August 1687, Leeuwenhoek wrote to the Royal Society (AB 102):
I have shown, among other things, also the above-mentioned parts of the Louse to his Royal Majesty of Great Britain (when he was lately in these Countries, and condescended, and did me the honour, to come to my house to inspect my humble experiments); and I recounted to him the use of the Sting, which the Louse carries in its abdomen, from which I gave the reason why the Soldiers, when drenched with rain, are plagued more by the Lice, than in dry weather. Which gave great amusement.
In a letter to his son Christiaan on May 4, 1679, (Oeuvres complètes,Vol. 8. p. 159, letter 2167) Constantijn Huygens indicated that the Duke visited Leeuwenhoek not long before that date. "M. le duq de Yorck, aijant esté veoir ces jours passez le magazin de delft. est aussi entré chez luij, où ie ne sçaij s'il aura bien trouué des curiositez viues assez en ordre."
James left the Republic in the fall of 1679. His biographer E. C. Turner wrote (1948, p. 168):
On September 24 [James] was on his way back to Brussels to rejoin the Dutchess and to make arrangements for his departure to Scotland. He made the same time as he had taken on the homeward journey, and he was in Brussels on the 27th, and he took so short a time over his preparations there that he was at The Hague with Mary Beatrice five or six days later. There he found ships to convey his retinue and belongings to Scotland, and he embarked, after bidding farewell to his daughter and son-in-law for the last time. ... They eventually arrived in London on October 14.
The dutchess, Maria Beatrice Anna Margherita Isabella d'Este (1658-1718), the daughter of Alfonso IV, Duke of Modena, was James’ second wife.
They went to The Hague before leaving because it was the home of Mary Stuart, James' oldest surviving child. Her husband, William of Orange, was Stadhouder of the Dutch Republic. They succeeded him on the throne in 1688.
Before that, in 1687, Leeuwenhoek dedicated Anatomia seu interiora rerum, a collection of his letters in Latin, to James, then James II, King of England.