It's a laptop... I see.
It doesn't close? That means when you push the CD-ROM tray inside it won't lock shut? If so its time to get a replacement...
If you mean it does lock shut, but it keeps ejecting:
Does it eject when you get into Windows? Or does it start ejecting once you hit the power button and before Windows is loaded?