Pour info, j'ai trouvé (merci Internet et notamment le site ci-dessous).
https://youtu.be/G-2khNFYQl8
Il suffit de lancer un script contenu dans un fichier VBS en début de macro.
Ce script scrute l'apparition du pop up (qui s'appelle Sécurité de Windows).
Contenu du fichier VBS:
'Creating a script object
Set oWSH = CreateObject("WScript.Shell")
'Activating alert screen
Do
ret = oWSH.AppActivate ("Sécurité de Windows")
Loop Until ret = True
WScript.Sleep 500
ret = oWSH.AppActivate ("Sécurité de Windows")
If ret = True Then
ret = oWSH.AppActivate ("Sécurité de Windows")
WScript.Sleep 10
'Passing the value UserName/UserID
oWSH.SendKeys "XXXXXXXXXXXXXXXXX" 'ensure to complete the username with apropriate domain e.g.
WScript.Sleep 10
'Changing the focus to password textbox
oWSH.SendKeys "{TAB}"
WScript.Sleep 10
'Passing the value password
oWSH.SendKeys "XXXXXXXXXXXXXXXXX" 'password
WScript.Sleep 10
'Clicking enter to complete the screen
oWSH.SendKeys "{ENTER}"
End If
'Releasing the script object
Set oWSH = Nothing
WScript.Sleep 500
Et dans la macro, on a ceci avant de demander l'accès au site en question:
Shell "wscript.exe ""chemin\fichier.vbs"""
Mon problème suivant est que le script reste actif après coup.
Si quelqu'un a une idée sur la manière de couper le script à la fin de la macro...
Merci d'avance.
A bientôt.