I have the same problem on my Dell PC w/ WinXP on it. Not sure if the Manufacturer or OS matters, but what I did was a google search "cd tray keeps opening" and came up with a bunch of issues.
One person suggested unplugging the data-cable from the back (if it's IDE, it a 2" ribbon cable, otherwise a SATA drive will have a red or blue 1/2" plug). Leave the power plugged to the CD-ROM (4-pin/wire). Of course, do this while the PC is powered down.
Then power up -- if the CD ROM still opens and closes, it's a possibility that the drive has some mechanical issues (eg. dirty open/close button, or just something haywire). If it doesn't open/close upon complete boot-up to Operating System (OS), then there could be some virus/malware on your system, despite your Anti-virus not finding anything...
Hope this helps.
Oh, BTW, my issue seemed to figure itself out after I tried unplugging the ribbon-cable from the back of the cd-drive... i guess something was dirty or was making a bad connection??? I haven't seen the issue for a few days now (compared to seeing the issue anytime my PC was on previous to the unplugging of the ribbon cable/data cable).