8

検索ボックスにテキストを入力するのに苦労していますが、正しい ID タグだと思います。ページのソース コードから ID を取得しました。以前に他のウェブサイトでこれを行ったことがあります。誰かが私を助けてくれますか?これを行う別の方法はありますか?

Sub FileUpload()

Dim IEexp as Object
IEexp.visible = True
IEexp.Navigate ("www.example.com")

'this is where the problem
IEexp.Document.GetElementByID("step1_id_bean_newSupportingDoc_description").Value _ 
= "monthly update"

End Sub

「オートメーション エラー、呼び出されたオブジェクトはクライアントから切断されました」というメッセージが表示されます。

ID を取得したソース コード:

<td class="Label">Description</td>
  <td class="Data"><input type="text" name="bean.newSupportingDoc.description" size="60" maxlength="250" value="" id="step1_id_bean_newSupportingDoc_description" class="NoBorder"/>
</td>
4

2 に答える 2

2

を使用するSet IEexp = New InternetExplorerMedium場合は、インターネット オプションの設定を変更する必要はありません。中間整合性アプリケーション設定で IE オブジェクトを自動的にインスタンス化します。

于 2013-10-31T12:20:35.547 に答える
0

あなたが試すことができます

Do Until IEexp.readyState = 4
DoEvents
Loop



IEexp.Document.getElementById("username").Value = "Monthly update"


IEexp.Document.getElementById("password").Value = FilePth
于 2013-03-07T15:04:02.207 に答える