1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
Sub ImportPic()
Dim suite As String, coller As String
Dim i As Long, j As Long, nIndex As Long
nIndex = WorksheetFunction.CountA(Range("B1:B100"))
coller = "^V"
For i = 2 To nIndex
If ActiveSheet.Name = "Feuil1" Then
GoTo suite
Else
Worksheets("Feuil1").Activate
End If
suite:
'Etape consistant a récupérer le nom de l'objet pour lequel je veux l'image
'et à enregistrer l'image dans le Papier Presse
Range("B" & i).Select
Selection.Copy
AppActivate "2-BLOOMBERG"
Application.SendKeys "{TAB}", True: Application.SendKeys coller, True
Application.SendKeys "{F10}", True: Application.SendKeys "~", True
Application.SendKeys "GP": Application.SendKeys "~"
Application.Wait Time + TimeSerial(0, 0, 2)
Application.SendKeys "MACD~"
Application.Wait Time + TimeSerial(0, 0, 2)
'Enregistrement de l'image dans le Presse-Papier
Application.SendKeys "97~"
Application.SendKeys "5~"
AppActivate "Microsoft Excel"
Workbooks("Classeur1.xls").Activate
Worksheets("Feuil2").Activate
Application.SendKeys coller, True
Next i
End Sub |
Partager