There were four or five different versions of treaties to partition the Spanish empire, starting in 1668 IIRC.
However Charles II never accepted the idea of partitioning his heredity, and in the end he willed the lot to Philippe of Anjou, with the only proviso that the crown of France and Spain would never be united. Louis XIV, who had recently agreed to a last version of the partition was surprised himself but could not resist the temptation of putting Philippe on the throne in Madrid. The result was a war lasting 12 years and costing France a fortune.
It didn't have to be a 12-year war. It could have been just a French-Austrian conflict, but Louis needlessly provoked England (by recognizing James II's son) and the Netherlands (by moving troops into the Spanish Netherlands), turning it into a general European war. Both countries had been willing to support the duc d'Anjou's claims up to then. It was a major blunder by Louis to antagonize them and nearly ended in disaster.
Last edited: