a device for treating pieces of a substrate at high pressure , piece by piece or in batches , with a treatment medium in the supercritical or near - critical state , includes a first pressure chamber , a pipe system for supplying and discharging the treatment medium , to and from the pressure chamber under high pressure and an electric motor , which is fixed to the housing in the first pressure chamber or in a second pressure chamber coupled to the first pressure chamber under the high pressure , for driving an actuator to carry out a mechanical action in the treatment medium . the electric motor is in this case open to the treatment medium and is disposed and designed to be accessible to the treatment medium , in such a manner that during the treatment of a substrate the treatment medium flows through and around the electric motor .