ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CD Tray? (https://www.excelbanter.com/excel-programming/419422-cd-tray.html)

Charlotte E.[_2_]

CD Tray?
 
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



Daniel.C[_2_]

CD Tray?
 
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




Charlotte E.[_2_]

CD Tray?
 

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

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


All times are GMT +1. The time now is 11:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com