打开和关闭在Excel中使用VBA的CD-ROM托盘
使用下面的宏,您可以打开和关闭CD-ROM托盘/门。声明Sub mciSendStringA库“ winmm.dll”(ByVal lpstrCommand作为字符串,_ ByVal lpstrReturnString作为任意值,ByVal uReturnLength作为长值,_ ByVal hwndCallback作为长值)
Sub OpenCDTray() mciSendStringA "Set CDAudio Door Open", 0&, 0, 0 End Sub Sub CloseCDTray() mciSendStringA "Set CDAudio Door Closed", 0&, 0, 0 End Sub