Re : Application Active info sur...en vba
Bonsoir , les events de workbook ne se déclenche pas avec un click sur la zone de titre.
voici le code actuellement:
Sub PageWeb() 'Ouvre IE avec un bouton
'Dim IE As Object déclarée en public
Dim i As Integer, texte As String, StrCol As String
NotReqResume = False
texte = ""
If ActiveCell.Column = 1 Then
texte = Cells(ActiveCell.Row, 2) & " " & Cells(ActiveCell.Row, 1)
Else
texte = Cells(ActiveCell.Row, 3) & " " & Cells(ActiveCell.Row, 2) & " " & Cells(ActiveCell.Row, 1)
End If
On Error Resume Next
Set IE = CreateObject("internetexplorer.application")
IE.Navigate Worksheets(NomAnex).Range("g1") '("http://www.amazon.fr/")
IE.Visible = True: IE.Top = 0: IE.Left = 150
Application.Wait Now + Worksheets(NomAnex).Range("g4") / 3600 / 24
For i = 1 To Worksheets(NomAnex).Range("g2")
SendKeys "{TAB}"
Next
SendKeys (texte)
For i = 1 To Worksheets(NomAnex).Range("g3") - Worksheets(NomAnex).Range("g2")
SendKeys "{TAB}"
Next
SendKeys (texte)
SendKeys "{ENTER}"
Application.Wait Now + 2 / 3600 / 24
'Set IE = Nothing
End Sub
Sub ColleResume() 'Colle un texte dans le pp dans une cell et ferme IE
'Dim IE As Object
Dim montexte As String, c As Range, i As Integer, mActuelleRow As Integer
If NotReqResume Then Exit Sub
NotReqResume = True
Application.EnableEvents = False
'On Error Resume Next
'Set IE = GetObject("internetexplorer")
IE.Quit
Set IE = Nothing
mActuelleRow = Actuellerow
Cells(3, 26).Select
On Error GoTo ppvide
ActiveSheet.PasteSpecial Format:="Texte", Link:=False, DisplayAsIcon:=False
i = 0
For Each c In Selection
If ActiveCell.Offset(i, 0) <> "" Then
montexte = montexte & c.Value & " "
End If
i = i + 1
Next c
Selection.ClearContents
Cells(mActuelleRow, 21).Activate
ActiveCell.WrapText = False
ActiveCell.Value = montexte
Cells(mActuelleRow, 3).Select
IniUFLivre
Application.EnableEvents = True
Exit Sub
ppvide:
Cells(mActuelleRow, 3).Select
i = MsgBox(" Le presse papier est vide")
End Sub
Je suppute qu'il faille passer par une API Windows mais là ça me dépasse.
Une solution ?
Merci de votre aide