In 1807 Ramillies was in the West Indies as part of a squadron under the command of Rear-Admiral Alexander Cochrane, who sailed in HMS Belleisle.
Following the concern in Britain that neutral Denmark was entering an alliance with Napoleon, in December Ramillies participated in Cochrane's expedition that captured the Danish islands of St Thomas on 22 December and Santa Cruz on 25 December.