Re : Application.ScreenUpdating ne fonctionne pas
Merci à tous pour vos réponses, mais entre-temps, j'ai trouvé la solution sur votre site.
J'ai ajouté le code ci-après et j'ai donc remplacé "Application.ScreenUpdating=false" par WindowUpdating (False).
Ca marche, même si je n'ai toujours pas l'explication.
Concernant la Référence invalide, proposée par l'un d'entre vous, je n'ai rien trouvé de suspect.
------------------------------< nouveau code>---------------------------
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
sub My_Proc
' application.screenupdating= false
WindowUpdating (False) 'to freeze the screen
' Code
...
' Fin du code
WindowUpdating (True) 'to unfreeze the screen
' application.screenupdating= true
End Sub
Sub WindowUpdating(Enabled As Boolean)
' Completely Locks the Whole Application Screen Area,
' including dialogs and the mouse.
Dim Res As Long
If Enabled Then
LockWindowUpdate 0 'Unlock screen area
Else
Res = LockWindowUpdate(GetDesktopWindow) 'Lock at desktop level
End If
End Sub