When Pitt returned to power in 1804, Dundas again entered office as First Lord of the Admiralty, where he introduced numerous improvements in the details of the department. Suspicion had arisen, however, as to the financial management of the Admiralty, of which Dundas had been treasurer between 1782 and 1800. In 1802 a commission of inquiry was appointed, which reported in 1805. The result was the impeachment of Dundas in 1806, on the initiative of Samuel Whitbread, for the misappropriation of public money. The trial attacted considerable notice because of widespread dislike of patronage and the Pittite 'system', anti-Scottish attitudes in England, bias, and wide support for financial and parliamentary reform. The attention promoted the revival of the radical movement both in parliament and in the country. This was the last impeachment trial ever held in the House of Lords. Although the process ended in an acquittal, and he was held guilty of nothing more than formal negligence, he never again held office, although this could partly have been because of Pitt's death in 1806. Melville was expelled from the Privy Council in 1805, but was readmitted in 1807. He declined an offer of an earldom in 1809. Lord Melville's first marriage was to Elizabeth, daughter of David Rannie, of Melville Castle, in 1765. She was only 14 at the time of the marriage. Almost all of his wealth (£10,000), as well as the castle, came to him through this marriage but he left Elizabeth in their country residence while he remained in Edinburgh, and she committed adultery (then known as "criminal conversation") with a Captain Everard Faukener in 1778. Within days she had confessed by letter to her husband, and approximately a month later they were divorced. She never saw her children again, dying in 1843. Henry Dundas, in accordance with the law of the time, kept all of the money and property. After this divorce Dundas was married again, to Lady Jane Hope, daughter of John Hope, 2nd Earl of Hopetoun, in 1793. He died in May 1811, in Edinburgh, aged 69, and was succeeded in his titles by his son from his first marriage, Robert. The Viscountess Melville later married Thomas Wallace, 1st Baron Wallace and died in June 1829. Dundas is buried in a vault in Old Lasswade Kirkyard, with most of his descendants. He was friends with John Graves Simcoe, Lieutenant Governor of Upper Canada.