Selectionner une option dans une liste
Bonjour,
J essaye de créer une macro qui permet de saisir des informations d une feuille dans un site internet.
Je bloque dans la premiere etape parce que ma macro doit selectionner une ou plusieurs option dans une select list mais je n arrive pas à le faire
voila le code source de ma page
Code:
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
put type="hidden" id="viewApplicationTitle" value="Afficher"/>
<form id="dashboard" name="dashboard" action="/vatrefund/application/dashboard" method="GET" class="common-form">
<input type="hidden" name="removeCompanyIdsFromSession" value="true" id="dashboard_removeCompanyIdsFromSession"/>
<div class="common-box fluid-row">
<div class="field-container">
<label for="vatNumberFilter">Dossier(s) de TVA sélectionné(s) [sélectionnez un seul pour ajouter des demandes] </label>
<select id="vatNumberFilter" name="multiselectVatNumberFilter" style="width: 500px" multiple="multiple">
<optgroup label="Dossier TVA principal">
<option value="8263"
>
LU99000056 (VAT Systems s.à r.l.)
</option>
</optgroup>
<optgroup label="Dossier(s) TVA secondaire(s)">
</optgroup>
<optgroup label="Mandat(s)">
<option value="733"
>
LU12640323 (Husky Injection Molding Systems Sa)
</option>
<option value="3018"
>
LU16946206 (Arval Luxembourg s.a.)
</option>
<option value="8169"
>
LU17343058 (John Zink International Luxembourg, Sàrl)
</option>
<option value="1016"
>
LU12977109 (Axus Luxembourg Sa)
</option>
<option value="10848"
>
LU24138012 (Will-Pharma Luxembourg sarl)
</option>
<option value="888"
>
LU22203670 (Kymco Lux s.a.)
</option>
<option value="10704"
>
LU16464483 (MERCEDES-BENZ FINANCIAL SERVICES BELUX SA)
</option>
<option value="1144"
>
LU12549000 (Paul Wagner Et Fils s.a.)
</option>
<option value="100"
>
LU11468149 (Les Domaines de Vinsmoselle)
</option>
<option value="1193"
>
LU15554966 (Sogeti Luxembourg s.a.)
</option>
</optgroup>
</select> |
et voila le code que j ai faite et qui marche pas :(
Code:
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
|
Set listSelectElem = IEDoc.all("vatNumberFilter")
'If (Range("B1").Value = "VAT Systems sarl") Then
' listSelectElem.Value = "8263"
' End If
'If (Range("B1").Value = "Husky Injec. Mold. Systems sa") Then
' listSelectElem.Value = "733"
'End If
' If (Range("B1").Value = "Arval Lux. Sa") Then
' listSelectElem.Value = "3018"
' End If
' If (Range("B1").Value = "John Zink Int. Lux sarl") Then
' listSelectElem.Value = "8169"
' End If
'' If (Range("B1").Value = "Axus Lux. sa") Then
' listSelectElem.Value = "1016"
' End If
' If (Range("B1").Value = "Will Pharma Lux. sarl") Then
' listSelectElem.Value = "10848"
'End If
' If (Range("B1").Value = "Kymco Lux sa") Then
' listSelectElem.Value = "888"
' End If
' If (Range("B1").Value = "Mercedes Benz Financial Serv. Belux sa") Then
' listSelectElem.Value = "10704"
'End If
' If (Range("B1").Value = "Paul Wagner Et Fils sa") Then
' listSelectElem.Value = "1144"
' End If
'If (Range("B1").Value = "Les Domaines de Vinsmoselle") Then
' listSelectElem.Value = "100"
' End If
'If Range("B1").Value = "Sogeti Luxembourg s.a." Then
' listSelectElem.Value = "1193"
'End If |
j ai aussi essayé
Code:
1 2 3 4 5 6 7 8 9
|
Set theElementCollection = IEDoc.all("vatNumberFilter")
For Each oElement In theElementCollection
Debug.Print oElement.Value
If oElement.nodeName = "SELECT" Then
oElement.Value = Worksheets("Feuil2").Range("B4").Value
End If
Next |
Help pleaaaase :roll:
Mercii