Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Public Declare Function sndPlaySoundA Lib "winmm.dll" _ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Sub User() Dim res As Long Dim MyBuff As String * 256 Dim MySize As Long MySize = 256 res = GetUserName(MyBuff, MySize) If res <> 0 Then MsgBox Left$(MyBuff, InStr(1, MyBuff, vbNullChar) - 1) Else MsgBox "Error, Not logged in" End If End Sub Sub SleepVBA() Do Until i = 5 i = i + 1 Range("C1") = i * 10 DoEvents Sleep 2000 Loop End Sub Public Sub PlayWav(filePath As String) sndPlaySoundA filePath, 0 End Sub Sub playTheSound() PlayWav ("C:\2011\023\sound\sound1.wav") End Sub