He represented Wigtown Burghs 1812–1821. In 1828, he became Assistant Secretary to the Treasury upon the premature decease of William Hill, and held that post until 22 January 1836, dying later that year.