G
Guest
I found this code to open and close the coffe holder. I pasted it into a
Module
Declare Sub mciSendStringA Lib "winmm.dll" (ByVal lpstrCommand As String,
ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long)
Public Sub OpenDefaultDiscTray()
mciSendStringA "Set CDAudio Door Open", 0&, 0, 0
End Sub
Public Sub CloseDefaultDiscTray()
mciSendStringA "Set CDAudio Door Closed", 0&, 0, 0
End Sub
Then I added a button the spreadsheet and added this code which doesn't
work. i get "Compile Error. Sub or Function not defined." The code to open
the CD tray works, but not when i try to call it from a button click event.
This seems like it should be really simple, but I don't know what I'm doing
wrong.
Private Sub CommandButton1_Click()
Call OpenDefaultDiscTray
End Sub
--
Billy Rogers
Dallas,TX
Currently Using SQL Server 2000, Office 2000 and Office 2003
Module
Declare Sub mciSendStringA Lib "winmm.dll" (ByVal lpstrCommand As String,
ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long)
Public Sub OpenDefaultDiscTray()
mciSendStringA "Set CDAudio Door Open", 0&, 0, 0
End Sub
Public Sub CloseDefaultDiscTray()
mciSendStringA "Set CDAudio Door Closed", 0&, 0, 0
End Sub
Then I added a button the spreadsheet and added this code which doesn't
work. i get "Compile Error. Sub or Function not defined." The code to open
the CD tray works, but not when i try to call it from a button click event.
This seems like it should be really simple, but I don't know what I'm doing
wrong.
Private Sub CommandButton1_Click()
Call OpenDefaultDiscTray
End Sub
--
Billy Rogers
Dallas,TX
Currently Using SQL Server 2000, Office 2000 and Office 2003