 In March 1798, France invaded Switzerland and declared the Helvetic Republic.Spreitenbach became a municipality in the short-lived canton of Baden; since 1803 the municipality has been in the canton of Aargau.On August 9, 1847 the railway between Zurich and Baden was opened.