As trurle mentioned, at some point, there's a limit to range simply because no matter how much propellant you add, the muzzle velocity is limited to approximately the sound speed in the propelling gas (which is much faster than the sound speed in the ambient atmosphere due to the high temperature inside the barrel). Once the projectile reaches this speed, the gas behind it cannot propel it any faster because it's moving as fast as the gas would be if it were just free expanding down the barrel (this isn't exactly the sound speed in the gas, but it's close enough).
The solution to this is to either use propellants with higher molecular velocity in their products (which, functionally, means finding an explosive with lighter mean molecular weight in the products), or to use more complex designs such as the "light gas gun", but we're already basically using the best propellant mix for our considerations of manufacturability, stability/storability, and performance. Light gas guns aren't feasible due to their complexity and the multiple additional components needed (and their much larger size). In addition, to reach these very high velocities, a very long barrel is needed, which hinders the usability of the weapon and makes it far more cumbersome to transport.
Because of these considerations, we've basically settled on ~40km as the maximum reasonable range for howitzers, and beyond that, it's more worthwhile to just switch to rocket artillery rather than trying to further increase the range of guns. That having been said, it is technically possible to exceed 100km range with a gun, it just requires a very large gun, both in the mass of fired projectiles (in order to minimize the effect of air drag) and in length (in order to achieve very high muzzle velocities). You can see this with the German
Paris Gun from WWI, which was absolutely massive, despite only being a slightly larger caliber than
more modern artillery, due to the incredibly long barrel required to hit the high muzzle velocity needed to have that kind of range. Compare that to more modern
rocket artillery that fits on the back of a truck and still is able to achieve over twice the range of even this extreme example.