Je n'arrive pas à activer une fenêtre pdf

Bonjour,

j'"ouvre mon pdf et prend des infos dedans, le problème c'est que le focus ne ce fait pas sur le pdf, j'aimerai un monfichier.pdf.activate mais je ne trouve pas...

NomPDF = Range("E" & i).Value & "/" & Range("A" & i).Value
ActiveWorkbook.FollowHyperlink Address:=NomPDF
 NomDeLafenetre = Range("A" & i) & " - Adobe Reader"
 Application.Wait (Now + TimeValue("0:00:02"))
 AppActivate "Adobe reader" 'ou j'ai même essayer avec NomDeLafenetre

"

Quelqu'un aurai une idée?

Sub OuvrirPDF() 'Ouvre un PDf et lit les informations
Dim NomPDF As String 'chemin+nom du fichier
Dim NomPdf2 As Object
Dim test As Variant
Dim n As Object
Dim MyAppID
x = 1
i = 2
Do While i < Sheets("Feuil1").Range("A65535").End(xlUp).Row + 1
NomPDF = Range("E" & i).Value & "/" & Range("A" & i).Value
 MyAppID = Shell("C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe", 1)
ActiveWorkbook.FollowHyperlink Address:=NomPDF
 NomDeLafenetre = Range("A" & i) & " - Adobe Reader"
 Application.Wait (Now + TimeValue("0:00:02"))

 AppActivate MyAppID ' erreur argument ou appel de procédure incorrect
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "^a" 'sélectionne la totalité du pdf
Application.SendKeys "^c" 'copie la totalité du pdf

ThisWorkbook.Sheets("Feuil2").Activate
Range("A" & x).PasteSpecial 'coller l'ensemble de ma sélection
 i = i + 1
 x = x + 1
Loop

End Sub

up

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub Extraire_Texte_de_Pdf()
Dim url, x
i = 2
With Sheets("Feuil1")
Do While i < .Range("A65535").End(xlUp).Row + 1
If .Range("E" & i) <> "" And .Range("A" & i) <> "" Then
url = .Range("E" & i) & "\" & .Range("A" & i) 'Adapter à votre fichier
'Ouvrir le fichier pdf avec le programme approprié

'Attendre 2 secondes

x = Shell("C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe " & url)

   Application.Wait (Now + TimeValue("0:00:02"))
 AppActivate ("- Adobe Reader")

Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "^a" 'sélectionne la totalité du pdf
Application.SendKeys "^c" 'copie la totalité du pdf

ThisWorkbook.Activate 'Redonner le focus à Excel
ThisWorkbook.Sheets("Feuil2").Select
Cells(1, i).Select
ActiveSheet.Paste
End If
i = i + 1
ThisWorkbook.Sheets("Feuil1").Select
Loop
End With
End Sub

ci joint la sollution,

naubin

Rechercher des sujets similaires à "arrive pas activer fenetre pdf"