Guided-mode resonances in structures having periodicity along at least one dimension were widely employed in the last decade in various optical devices. Initially it was shown that at frequencies close to the second order band gap periodic structures can feature total reflection of light due to the guided modes propagating along the surface of the grating. As an application, this allows to substitute a thick multilayer Bragg mirror in VCSELs by a thin grating-based mirror. Most devices utilizing guided-mode resonances were theoretically and numerically investigated with the idealized model of an infinite periodic structure illuminated by a plane wave. To see how grating-based components can perform in real life we take into account two critical factors: the finite size of the grating and the Gaussian shape of the light source replacing a plane wave. These factors can significantly change and impair the performance of filters, mirrors, sensors and other devices operating by the guided-mode resonance effect. We also show experimentally that for some kinds of gratings guided-mode resonances can vanish if the grating is illuminated by extended source, i.e. heated plate in our case, focused on the sample.