Sub Essai()
Application.Wait Now + TimeValue("0:00:01")
ThisWorkbook.FollowHyperlink ThisWorkbook.Path & "\Essai.pdf"
End Sub
Sub Essai()
'Application.Wait Now + TimeValue("0:00:01")
ExecuteExcel4Macro ("CALL(""user32"",""keybd_event"",""JJJJJ""," & &H11 & ", " & 0 & ", " & &H2 & ", " & 0 & ")") 'api SetWindowLongA
CreateObject("Shell.Application").Open ("C:\Users\polux\DeskTop\Test.pdf")
End Sub
Sub essai2() 'légèrement plus rapide
On Error Resume Next
ExecuteExcel4Macro ("CALL(""user32"",""keybd_event"",""JJJJJ""," & &H11 & ", " & 0 & ", " & &H2 & ", " & 0 & ")") 'api SetWindowLongA
CreateObject("WScript.Shell").Run ("C:\Users\polux\DeskTop\Test.pdf")
End Sub
Sub test()
Dim spath
spath = "C:\Users\STAPLE\Documents\test.pdf"
ThisWorkbook.FollowHyperlink spath
End Sub