I ordered and replaced the latch. That was easy. But the door still would not stay closed. After research I realized that like so many others, the upper frame of the dishwasher had flexed over time and needed to be pressed down to engage the latch. I ended up making a shim to fit between the top of the dishwasher and the bottom of the counter to hold the frame down. Problem solved.