There is a growing interest in the development of routes to produce formic acid from CO2, such as the electrochemical reduction of CO2 to formic acid. The solubility of CO2 in the electrolyte influences the production rate of formic acid. Here, the dependence of the CO2 solubility in aqueous HCOOH solutions with electrolytes on the composition and the NaCl concentration was studied by Continuous Fractional Component Monte Carlo simulations at 298.15 K and 1 bar. The chemical potentials of CO2, H2O, and HCOOH were obtained directly from single simulations, enabling the calculation of Henry coefficients and subsequently considering salting in or salting out effects. As the force fields for HCOOH and H2O may not be compatible due to the presence of strong hydrogen bonds, the Gibbs-Duhem integration test was used to test this compatibility. The combination of the OPLS/AA force field with a new set of parameters, in combination with the SPC/E force field for water, was selected. It was found that the solubility of CO2 decreases with increasing NaCl concentration in the solution and increases with the increase of HCOOH concentration. This continues up to a certain concentration of HCOOH in the solution, after which the CO2 solubility is high and the NaCl concentration has no significant effect.