It's probably not the PIC's fault that it won't run at 40Mhz, it's probably the circuit board's fault. The PIC will run all day at 40Mhz (55Mhz for one of mine that I pushed up a bit) even with an external 40Mhz. The key is a well designed 40Mhz external oscillator. There's a dozen reasons why a 40Mhz crystal won't run if it's not built right, especially if you're using one of those plastic solderless breadboards. Besides that, the external 10Mhz will keep down EMI over the whole circuit board.
Bookmarks