ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detecting the drive letter of a user's CD (https://www.excelbanter.com/excel-programming/309805-detecting-drive-letter-users-cd.html)

Charles Jordan

Detecting the drive letter of a user's CD
 
(Windows XP, Excel 2000). We are endeavouring to open, with IE, a file
called "index.html" which we know is on the users's CD, but we don't
know the drive letter - ie. C:, D:, E:, F: etc. How can we find this ?
is there a wildcard option way of doing it ?

TIA - Charles

Harald Staff

Detecting the drive letter of a user's CD
 
Hi Charles

See Randy Birch's page
http://vbnet.mvps.org/code/disk/getmediatype.htm
and also
http://vbnet.mvps.org/code/disk/index.html

HTH. Best wishes Harald

"Charles Jordan" skrev i melding
om...
(Windows XP, Excel 2000). We are endeavouring to open, with IE, a file
called "index.html" which we know is on the users's CD, but we don't
know the drive letter - ie. C:, D:, E:, F: etc. How can we find this ?
is there a wildcard option way of doing it ?

TIA - Charles




Charles Jordan

Detecting the drive letter of a user's CD
 
"Harald Staff" wrote in message ...
Hi Charles

See Randy Birch's page
http://vbnet.mvps.org/code/disk/getmediatype.htm
and also
http://vbnet.mvps.org/code/disk/index.html

HTH. Best wishes Harald

"Charles Jordan" skrev i melding
om...
(Windows XP, Excel 2000). We are endeavouring to open, with IE, a file
called "index.html" which we know is on the users's CD, but we don't
know the drive letter - ie. C:, D:, E:, F: etc. How can we find this ?
is there a wildcard option way of doing it ?

TIA - Charles


Harald - this is at least the second time that you have helped me - it
is very much appreciated. Charles

Chip Pearson

Detecting the drive letter of a user's CD
 
Charles,

Set a reference (VBA, Tools menu, References) to the Microsoft
Scripting Runtime library, and use code like the following:

Dim FSO As New Scripting.FileSystemObject
Dim Drv As Scripting.Drive
For Each Drv In FSO.Drives
If Drv.DriveType = CDRom Then
Debug.Print Drv.DriveLetter
End If
Next Drv



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Charles Jordan" wrote in
message om...
(Windows XP, Excel 2000). We are endeavouring to open, with IE,
a file
called "index.html" which we know is on the users's CD, but we
don't
know the drive letter - ie. C:, D:, E:, F: etc. How can we find
this ?
is there a wildcard option way of doing it ?

TIA - Charles




Charles Jordan

Detecting the drive letter of a user's CD
 
"Chip Pearson" wrote in message ...
Charles,

Set a reference (VBA, Tools menu, References) to the Microsoft
Scripting Runtime library, and use code like the following:

Dim FSO As New Scripting.FileSystemObject
Dim Drv As Scripting.Drive
For Each Drv In FSO.Drives
If Drv.DriveType = CDRom Then
Debug.Print Drv.DriveLetter
End If
Next Drv



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Charles Jordan" wrote in
message om...
(Windows XP, Excel 2000). We are endeavouring to open, with IE,
a file
called "index.html" which we know is on the users's CD, but we
don't
know the drive letter - ie. C:, D:, E:, F: etc. How can we find
this ?
is there a wildcard option way of doing it ?

TIA - Charles



Chip - I have been away and only just caught up with my messages.

I never fail to be amazed at the public spirit of you, and your
colleagues on this NG for volunteering your time and knowledge in this
*priceless* way. You may not remember, but I do, how you produced the
code for moving clock hands a year or two back, which has transformed
a key bit of our interactive economics textbook project. If ever you
are in Scotland, I very much hope that you will take the small
additional trouble of contacting me on
so we can hopefully say thank you properly, up here in the Highlands.
For what it's worth, your name also appears in the book's credits, and
extremely well earned too.

Thanks.

Charles


All times are GMT +1. The time now is 05:35 AM.

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