2016-08-10 27 views
1

私はaddacquisitionButtonをクリックしようとしていますが、できません。 私はこのコードVBAコードからIEページのボタンをクリック

Set div = ie.document.body.getElementsByTagName("div")(0) 
Set div = ie.document.body.getElementsByTagName("div")(1) 
Set Button = div.getElementsByTagName("button")(2) ' 
Button = IEDoc.getElemntsById("addAcquisitionButton") 
Button.Click 

を試みたが、それはtはこれが私のHTMLページからソースコードを、私が間違って取得しています

enter code here 
<div class="common-box blue-box" id="actionsPanel" style="z-index: 100;"> 
    <div id="actionContainer" class="button-container"> 
     <button class="button buttonAction" id="dashboardButton"> 
      Retour à l'aperçu des demandes 
     </button> 

       <button class="button buttonAction" id="addAcquisitionButton"> 
       Ajouter acquisition/importation 
       </button> 


      <button class="button buttonAction" id="attachButton"> 
       Attacher documents 
      </button> 


    </div> 

ある

仕事doesnの。

答えて

0

idで要素を検索するのが常にベストです。 divをこのように設定してみてください。

Set div = ie.document.body.getElementsById("actionContainer") 

と同じよう

Set Button = div.getElementsById("addAcquisitionButton") 
0

ボタンを取得し、私は438をgoterror、 オブジェクトはこのプロパティまたはメソッド

をサポートしていません。
関連する問題