Do you have any hidden tracks ? At least when this happens to me, that's what's causing it . . . usually an automation on a hidden track, or one I just can't see easily on a non hidden track.
I usually have to create "start" and "end" markers, then select "from" and "thru" points when exporting to audio.
I like bitman's idea to have a hard end point, despite what might be out in the nether regions on various tracks.
There's also . . . EDIT . . . Delete Special, then checkbox "Delete Hole"
(after selecting all bars and tracks past the end of you project)
Sometime works, but doesn't work for me in every project scenario.