CD Tray?

C

Charlotte E.

Is it possible to DETECT weather the CD tray of a given CD/DVD ROM drive is
open or closed via Excel VBA?

I can find a number of macros out there, which open or close the CD Tray,
but is it possible to create a UDF that DETECTS if the tray is open?


TIA,


CE
 
D

Daniel.C

As far as I know, it is only possible to detect if the drive is ready :

Set fso = CreateObject("scripting.filesystemobject")
If fso.getdrive("d:").IsReady = True Then
MsgBox "drive with CD inside"
Else
MsgBox "no CD or tray open"
End If

Regards.
Daniel
 
C

Charlotte E.

Thanks, Daniel,


But, I already knew about that one - only problem is that it does not quite
do what I want...

I figure that some sort of API call/programming is required, but that's a
point where I'm absolutely lost...

So, I'm still hoping that one of all the VBA/API sharks in here can solve
this one for me :)


Thanks, anyway, Daniel :)
 
D

Dave Peterson

If you don't get an answer in the Excel newsgroups, you may want to post in a VB
newsgroup. Remember to include that you're code will be in Excel's VBA (and
include the excel version).

They may even tweak the code to work in VBA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top