Why decarbonate soda for spectroscopy experiment? I did an experiment with a nanodrop photometer where I had to find the amount of caffeine and benzoic acid in soda. During the experiment, we were to decarbonate the soda by heating it. I've done a similar experiment before where I had to add salt to decarbonate soda. I've also read similar procedures where soda was decarbonated by shaking.

My question is this: Why should the soda be decarbonated?

My thought is perhaps the air pockets in the soda (due to $\ce{CO2}$) could cause discrepancies in absorbance due to changes in the refractive index.

I also thought that perhaps $\ce{CO2}$ absorbs in the same region as caffeine and/or benzoic acid, but NIST does not appear to have UV/Visible spectrum data for $\ce{CO2}$, whereas it UV/Visible spectrum data for caffeine. Please pardon my naiveté here, but I'm then assuming $\ce{CO2}$ thus does not absorb in UV/Vis?
The primary reason is that when soda warms up, the $\ce{CO2}$ would escape slowly as bubbles. These bubbles would significantly scatter light affecting the absorption spectra. Usually, the effect of such scattering is quite pronounced and the absorption bands of individual molecules will be (might be) buried below the broadened feature in the lower wavelength region.

In colloidal and suspension systems light is scattered by individual particles. These particles are larger in size than the wavelength of light and such scattering phenomena is termed as Tyndal scattering or Tyndall effect.  For such a process, the scattering coefficient has $wavenumber^{4}$ dependence which means that for lower wavelengths the scattering increases significantly. Thus when the sample has particles then absorption spectra is skewed and we see an increasing absorption peak when going to a lower wavelength. (You can yourself try this with milk which is a suspension).

About the absorption spectrum of $\ce{CO2}$:

$\ce{CO2}$ being a simple molecule is expected to have electronic absorption bands below 300nm. It does have electronic absorption between 200 to 270 nm. It is more difficult to find on the internet since usual absorption of $\ce{CO2}$ is referred to the vibrational absorption observed in the in the infrared region. Hence, 'UV absorption of $\ce{CO2}$' is a better search term.

For your reference: T. Joutsenoja, A. D'Anna, A. D'Alessio, and M. I. Nazzaro, "Ultraviolet Absorption Spectra of Carbon Dioxide and Oxygen at Elevated Temperatures," Appl. Spectrosc. 55, 130-135 (2001)