 He spent his final years in West Coates House in Edinburgh in 1822.He died at West Coates House in west Edinburgh on 30 May 1824.He is buried in the churchyard of St John's Church on Princes Street in Edinburgh.