Open/Close CD Tray using VBA
Paste the following code in a module and try the two modules for open or close CD Tray.
Declare Sub mciSendStringA Lib "winmm.dll" (ByVal lpstrCommand As String, _ ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, _ ByVal hwndCallback As Long) Sub CDTrayOpen() mciSendStringA "Set CDAudio Door Open", 0&, 0, 0 End Sub Sub CDTrayClose() mciSendStringA "Set CDAudio Door Closed", 0&, 0, 0 End Sub
»
- Vishesh's blog
- Login or register to post comments
- 15402 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago