In this Full Paper, the possibility of reversibly changing the diffraction efficiency of gratings, fabricated by soft molding lithography on polymer films, containing photochromic molecules, is demonstrated. In particular, alternating UV and visible laser irradiation of the gratings causes the doped photochromic molecules to undergo transformations, which induce reversible dimensional changes to the samples. As a result, reversible changes are monitored in the intensity of the beams of a diode laser, transmitted and diffracted from the gratings. These changes affect the diffraction efficiency, which is increased upon irradiation with UV and decreased after irradiation with visible laser light. Such gratings are promising candidates for the fabrication of modern optical components such as optical switching devices.