ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   retieving cd title and placing it into excel (https://www.excelbanter.com/excel-programming/358162-retieving-cd-title-placing-into-excel.html)

Jon[_21_]

retieving cd title and placing it into excel
 
Is there any way to get the title of a cd and paste it into a cell?

For example, I want to be able to insert a disc into my cd-rom and run
a macro that looks at the cd and records its 'title'. Title being what
shows up in windows explorer next to the drive letter.


Jim Cone

retieving cd title and placing it into excel
 
Sub ShowDriveInfo(ByRef drvPath As String)
Dim fso As Object
Dim drv As Object
Dim s As String
Set fso = CreateObject("Scripting.FileSystemObject")
Set drv = fso.GetDrive(fso.GetDriveName(drvPath))
s = "Drive " & UCase(drvPath) & " " & drv.VolumeName & " "
MsgBox s, vbInformation, " Drive Volume"
Set drv = Nothing
Set fso = Nothing
End Sub
'----------
Sub GetInfo()
Call ShowDriveInfo("E:\")
End Sub
----------
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Jon"
wrote in message
oups.com...
Is there any way to get the title of a cd and paste it into a cell?

For example, I want to be able to insert a disc into my cd-rom and run
a macro that looks at the cd and records its 'title'. Title being what
shows up in windows explorer next to the drive letter.


Jon[_21_]

retieving cd title and placing it into excel
 
Thanks for the reply.

I ended up using Dir("f:", vbVolume)

This did what I wanted to do.



All times are GMT +1. The time now is 10:01 PM.

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