You do not have to get in shape before you start strength training. Strength training is one of the ways you get there—and beginning after 40 can be much simpler than you think.
If your only measure of progress is the number on the scale, you're overlooking some of the most meaningful changes your body can make after 40. Body composition tells a much more complete story than body weight ever will.