Bonjour
Je cherche à écrire un code pour cliquer le «Exporter vers Excel» et j'ai besoin d'aide.

Voici mon code actuel sans succès!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Sub MyLogin()
Dim IE As Object
Dim div As Variant
      Set IE = CreateObject("InternetExplorer.application")
      IE.Visible = True
      IE.navigate ("http://cpcpw6lb.cpggpc.ca/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?BOOKMARK=00BAVE49W2BVMYV26LH0N4FYY")
      Do
          If IE.readyState = 4 Then
              Exit Do
          Else
             DoEvents
         End If
     Loop
     On Error Resume Next
 
     IE.document.Forms(0).all("j_username").Value = "xxxxx"
     IE.document.Forms(0).all("j_password").Value = "xxxxx"
     IE.document.Forms(0).submit
 
        Do
          If IE.readyState = 4 Then
              Exit Do
          Else
             DoEvents
         End If
     Loop
 
IE.document.getElementById("BUTTON_GROUP_ITEM_1_btn4_acButton").Click
 
End Sub
Voici le code html du bouton!
Nom : html.PNG
Affichages : 114
Taille : 13,1 Ko

En espérant que ce bout de code pourra aider!

Code JavaScript : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
var elems=fref.parent.document.getElementsByTagName("iframe");
for(var i=0; i< elems.length; i++){
if (elems[i].contentWindow == fref){
fref.name=elems[i].id;
break;}

Nom : Capture.PNG
Affichages : 119
Taille : 9,8 Ko