In 1705, Wills accompanied the Earl of Peterborough to Spain as quartermaster-general, serving at the capture of Barcelona on 4 October 1705; nine days later, he was made colonel of a regiment of marines, later the 30th Foot. In January 1706, he participated in a brief but bloody encounter at San Esteban de Litera, taking command when Major-General Conyngham was mortally wounded. He was also part of the garrison during the unsuccessful Bourbon attempt to retake Barcelona in April 1706, and was promoted brigadier-general on 1 January 1707.