Abstract: The invention provides a device for attaching solar modules that enables an agreeable integration into a roof and which is easy to install. A frame is provided which consists of two lateral frame members, an upper and a lower frame member. Each of the four frame members comprises an area having a rectangular cross section with two long and two narrow sides. The four frame members are interconnected such that the long sides are disposed perpendicular to the main surface of the solar module or the solar cell. It is thereby achieved that the frame is torsion-resistant. Therefore, the solar module can be transported and mounted with comparatively few problems. Such a solar module is attached to a batten of a pitched roof with a projecting portion, in particular by bolting.