graemeal
Active Member
- Joined
- May 17, 2007
- Messages
- 316
- Platform
- Windows
I have just upgraded to windows 7 64 bit and Excel 2010 64 bit. When I open my files from excel 2007 I get this error. Compile error: The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute. In the first code that pops up it has highlighted the Function word at the top.
I have no idea what to do.
Thanks
I have no idea what to do.
Thanks
Code:
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Private Sub Worksheet_Calculate()
Const FName1 As String = "C:\WINDOWS\Media\ding.wav"
Const FName2 As String = "C:\WINDOWS\Media\beep-3.wav"
Const FName3 As String = "C:\WINDOWS\Media\ringout.wav"
Dim h As Range
For Each h In Range("AB2:AB1872")
If h.Value > 1 Then
Call PlaySound(FName1, 0&, SND_SYNC Or SND_FILENAME)
Exit For
End If
Next h
For Each k In Range("AC2:AC1872")
If k.Value < -1 Then
Call PlaySound(FName1, 0&, SND_SYNC Or SND_FILENAME)
Exit For
End If
Next k
For Each i In Range("U2:U15")
If i.Value > 10 Then
Call PlaySound(FName2, 0&, SND_SYNC Or SND_FILENAME)
Exit For
End If
Next i
For Each j In Range("O2:O1872")
If j.Value > 35 Then
Call PlaySound(FName3, 0&, SND_SYNC Or SND_FILENAME)
Exit For
End If
Next j
End Sub