'To give a time delay
' Source: http://www.exceltrick.com/formulas_macros/vba-wait-and-sleep-functions/
#If VBA7 Then
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) 'For 64 Bit Systems
#Else
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 'For 32 Bit Systems
#End If
#If VBA7 Then
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) 'For 64 Bit Systems
#Else
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 'For 32 Bit Systems
#End If
Hi Khalid ,
The result is NOT the same !
The first error you posted has nothing to do with the error you are showing now.
It is possible that the Brightness property was added only in Excel 2010 , and if you are using Excel 2007 , you will get this error , there is nothing that can be done about it.
Narayan
Simply comment out the line