His cousin Maximilian III Joseph, Elector of Bavaria, died without children in December 1777. Their mutual cousin, Charles Theodore of Sulzbach, then Elector Palatine, succeeded Maximilian Joseph as prince elector. However, Charles Theodore had no legitimate children to inherit his combined holdings in Bavaria and the Palatinate, so Charles August became the heir to the Wittelsbach territories of: Zweibrücken (his own duchy), the duchies of Neuburg, Sulzbach, Julich and Berg, in addition to the electorates of the Palatinate and Bavaria (though exercising only one electoral vote in the College of Electors, as stipulated in the Treaty of Westphalia in 1648). Charles Theodore preferred the Palatinate and therefore tried to exchange parts of his Bavarian inheritance with Joseph II of Austria in return for parts of the Austrian Netherlands. Although Charles Theodore would have preferred to exchange the entire complex of territories of Bavaria for the Austrian Netherlands, the Austrian court would not countenance an outright exchange and a final arrangement was never concluded.