Operating the coating or treatment in a controlled atmosphere