During the War of the Spanish Succession, foreign subsidies amounted for almost half of the revenue raised by Savoy to fight the war. The end of the Nine Years' War had helped to design a new balance on the continent: at the death the childless Charles II of Spain he left his throne to Philip, grandson of Louis XIV. The will stated that should Philip not accept it would go to his brother Charles. Victor Amadeus was himself in line to succeed, as a great-grandson of Infanta Catherine Michelle of Spain. As a result, Victor Amadeus expected compensation in the form of a territory which had been owned by the vast Spanish empire. Victor Amadeus had his eye on the Duchy of Milan which, having signed a treaty with Louis XIV, had support in conquering the duchy. With the Treaty of Vigevano in October 1696, however Louis XIV's support waned. Victor Amadeus subsequently allied himself with Emperor Leopold I.