Thread: CD Tray?
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default CD Tray?

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.

"Charlotte E." wrote:

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 :-)

Daniel.C wrote:
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

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


--

Dave Peterson