A surgical stapling device has an elongated body (14) and a removable loading unit (16) and a securing structure for securing the loading unit onto the elongated body. Guiding ramps (302) guide the movement of the loading unit as it is mounted onto the elongated body. A movable yoke (400) secures the loading unit onto the elongated body. A sensor mechanism (510) is engaged by the loading unit and moves with the securing structure. The locking structure has a first position for blocking movement of the sensor mechanism and preventing removal of the loading unit. The locking unit has a second position for allowing the loading unit to be removed from the device.