A printing apparatus that performs printing by a printing portion, wherein the printing portion includes a print head and is enclosed in a casing of the printing apparatus, the printing apparatus comprising: lock means arranged to lock an openable portion formed as part of the casing display means arranged to display, on a display portion, a predetermined screen for accepting a predetermined user operation for unlocking the openable portion based on an occurrence of an error in at least part of the printing portion; detection means arranged to detect that the predetermined user operation is performed on the predetermined screen in a state where the openable portion is locked; execution means arranged, in a case where the predetermined user operation has been detected, to execute predetermined preparation processing on the printing portion, wherein the predetermined preparation processing includes at least one of processing for storing information about ink into a memory provided in an ink tank processing for closing a supply valve configured to supply the ink from the ink tank processing for moving the print head to a replacement position for replacing the print head, and processing for opening a head cover configured to cover the print head, and processing for stopping power supply to at least part of the printing portion, and; unlock means arranged, in a case where the predetermined user operation performed on the predetermined screen has been detected, to unlock the openable portion after the predetermined preparation processing is executed; wherein, even when a user operation for force opening the openable portion is executed on the openable portion in the state where the openable portion is locked, the openable portion is not opened and the predetermined preparation processing is not executed. lock means arranged to lock an openable portion formed as part of the casing display means arranged to display, on a display portion, a predetermined screen for accepting a predetermined user operation for unlocking the openable portion based on an occurrence of an error in at least part of the printing portion; detection means arranged to detect that the predetermined user operation is performed on the predetermined screen in a state where the openable portion is locked; execution means arranged, in a case where the predetermined user operation has been detected, to execute predetermined preparation processing on the printing portion, wherein the predetermined preparation processing includes at least one of processing for storing information about ink into a memory provided in an ink tank processing for closing a supply valve configured to supply the ink from the ink tank processing for moving the print head to a replacement position for replacing the print head, and processing for opening a head cover configured to cover the print head, and processing for stopping power supply to at least part of the printing portion, and; unlock means arranged, in a case where the predetermined user operation performed on the predetermined screen has been detected, to unlock the openable portion after the predetermined preparation processing is executed; wherein, even when a user operation for force opening the openable portion is executed on the openable portion in the state where the openable portion is locked, the openable portion is not opened and the predetermined preparation processing is not executed. <EOS>