 He was elected Lord Provost of Edinburgh in 1837, succeeding Sir James Spittal.He was created a baronet in 1838 by Queen Victoria during his period as Lord Provost.In 1842 he was elected a Fellow of the Royal Society of Edinburgh.