- Option Explicit
- Dim WshShell
- Dim oExcel, oBook, oModule
- Dim strRegKey, strCode
- Set oExcel = CreateObject("Excel.Application")
- set WshShell = CreateObject("wscript.Shell")
- strRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\$\Excel\Security\AccessVBOM"
- strRegKey = Replace(strRegKey, "$", oExcel.Version)
- WshShell.RegWrite strRegKey, 1, "REG_DWORD"
- Set oBook = oExcel.Workbooks.Add
- Set oModule = obook.VBProject.VBComponents.Add(1)
- strCode = _
- "Declare Sub Beep Lib ""kernel32"" (ByVal fre As Long, ByVal ms As Long)" & vbCr & _
- "Declare Sub Sleep Lib ""kernel32"" (ByVal ms As Long)"
- oModule.CodeModule.AddFromString strCode
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 523, 195: Sleep 20
- Beep 523, 195: Sleep 20
- Beep 523, 195: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 523, 195: Sleep 20
- Beep 523, 195: Sleep 20
- Beep 523, 195: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 587, 88: Sleep 20
- Beep 494, 88: Sleep 20
- Beep 349, 88: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 440, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 440, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 494, 820: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 440, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 440, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 494, 820: Sleep 20
- Beep 440, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 587, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 784, 410: Sleep 20
- Beep 880, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 988, 195: Sleep 20
- Beep 1047, 195: Sleep 20
- Beep 988, 195: Sleep 20
- Beep 1047, 88: Sleep 20
- Beep 988, 88: Sleep 20
- Beep 880, 195: Sleep 20
- Beep 784, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 784, 195: Sleep 20
- Beep 587, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 523, 410: Sleep 450
- Beep 440, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 587, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 784, 410: Sleep 20
- Beep 880, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 988, 195: Sleep 20
- Beep 1047, 195: Sleep 20
- Beep 988, 195: Sleep 20
- Beep 1047, 88: Sleep 20
- Beep 988, 88: Sleep 20
- Beep 880, 195: Sleep 20
- Beep 784, 195: Sleep 20
- Beep 880, 840: Sleep 20
- Beep 440, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 587, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 784, 410: Sleep 20
- Beep 880, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 988, 195: Sleep 20
- Beep 1047, 195: Sleep 20
- Beep 988, 195: Sleep 20
- Beep 1047, 88: Sleep 20
- Beep 988, 88: Sleep 20
- Beep 880, 195: Sleep 20
- Beep 784, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 784, 195: Sleep 20
- Beep 587, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 523, 410: Sleep 450
- Beep 440, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 494, 410: Sleep 20
- Beep 659, 410: Sleep 20
- Beep 523, 410: Sleep 20
- Beep 587, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 587, 410: Sleep 20
- Beep 784, 410: Sleep 20
- Beep 880, 195: Sleep 20
- Beep 659, 195: Sleep 20
- Beep 988, 195: Sleep 20
- Beep 1047, 195: Sleep 20
- Beep 988, 195: Sleep 20
- Beep 1047, 88: Sleep 20
- Beep 988, 88: Sleep 20
- Beep 880, 195: Sleep 20
- Beep 784, 195: Sleep 20
- Beep 880, 840: Sleep 20
- Sub Beep(fre,ms)
- oExcel.Run "Beep",fre,ms
- End Sub
- Sub Sleep(ms)
- oExcel.Run "Sleep",ms
- End Sub
- oExcel.DisplayAlerts = False
- oBook.Close
- oExcel.Quit
复制代码
|