Hole-doped cuprate superconductors show a ubiquitous tendency towards charge order. Although onset of superconductivity is known to suppress charge order, there has not so far been a decisive demonstration of the reverse process, namely, the effect of charge order on superconductivity. To gain such information, we report here the dependence of the critical temperature Tc of YBa2Cu3O6.67 on in-plane uniaxial stress up to 2 GPa. At a compression of about 1 GPa along the a axis, 3Dcorrelated charge density wave (3D CDW) order appears. We find that Tc decreases steeply as the applied stress crosses 1 GPa, showing that the appearance of 3D CDW order strongly suppresses superconductivity. Through the elastocaloric effect we resolve the heat capacity anomaly at Tc, and find that it does not change drastically as the 3D CDW onsets, which shows that the condensation energy of the 3D CDW is considerably less than that of the superconductivity.