We present the formulation of a scattering matrix method for the study of light-scattering properties of metal films. The method is employed for the study of the optical excitation of surface plasmons in a gold film of 15-230 nm thickness, patterned periodically with subwavelength nanoholes. The gold film is placed on a thick SiO2 wafer, and the nanoholes as well as the top side of the gold film are filled with H2O. Light is incident on the gold film from either the SiO2 or the H2O side. The extinction and reflectance spectra of the system, as well as the electromagnetic field distributions at certain characteristic wavelengths, are calculated. The extinction spectra show, depending on system parameters, one or several peaks in the visible wavelength range. The extinction peaks are found to be caused by surface plasmons. A simple model based on the dispersion relation for surface plasmons in an unperforated gold film is shown to predict the peak positions of the extinction for thick perforated films very well. Even for thin films, this simple model, which includes coupling of surface plasmons on both surfaces of the film, predicts peak positions of the extinction well if the hole diameter is small enough. As the hole diameter increases, the extinction peaks of thin films show redshifts. Extinction peaks caused by surface plasmons at the SiO2/Au interface in thick films exhibit strong redshifts when the film thickness is decreased. However, the extinction peaks caused by surface plasmons at the H2O/Au interface in thick films show a completely different behavior. In this case, the extinction peaks do not move noticeably when the film thickness is decreased. Instead, they are weakened and finally disappear. It is also found that each extinction peak is accompanied by an extinction dip and that a reflectance dip is located in the wavelength between the extinction peak and the dip. This arrangement of an extinction peak, a reflectance dip, and an extinction dip is a general property of the surface-plasmon excitation. The calculated electromagnetic field distributions in both thick and thin films show clearly the signature of the excitation of surface plasmons at the extinction peaks, the extinction dips, and the reflectance dips. In thick films with small holes, the electric-field strength in the vicinity of the holes is weak at wavelengths for which surface plasmons are excited. In contrast to this, for thin films at the surface-plasmon excitations, a much stronger electric field is seen in the vicinity of the holes. (Less)