0
私はVBA Excelのスクリプトを経由してWebページ上のボタンをクリックしようとしているが、以下のコードを使用しているとき、私はランタイムエラーを取得しています:JavaScript VBAでJavaScript onClickイベントを有効にするには?
objIE.document.getElementById("e-actions-commonmasthead-mail").Click
Iから取得しようとしている要素ページは次のHTMLで表示されます:
<td id="e-actions-commonmasthead-mail"
class="s-cell-center s-toolbarcell-left s-toolbar-text s-toolbarcell-selected"
title="Mail" toolbarside="left" toolbarindex="0"
com_ibm_dwa_ui_toolbar_overflowed="false"
onmouseover="AAA.DSq.EKc.prototype.EYl['e-actions-commonmasthead:Ebx'].EEu(event, this);"
onmouseout="AAA.DSq.EKc.prototype.EYl['e-actions-commonmasthead:Ebx'].EEu(event, this);"
onclick="AAA.DSq.ELU(event, 'e-actions-commonmasthead', 'Gqj', {area:'mail'});"
unselectable="on" style="-moz-box-sizing:border-box;-webkit-user-select:none;">
<img align="center" border="0" width="16" height="16"
id="e-actions-commonmasthead-mail-icon"
class="s-toolbaricon-notext"
src="/iNotes/Forms9.nsf/transparent.gif?OpenFileResource&MX&TS=20160816T154745,21Z"
xoffset="" yoffset=""
style="background-image: url("/iNotes/Forms9.nsf/sprite_masthead.png?OpenFileResource&MX&TS=20160816T154745,21Z");
background-position: -17px 0px;">
</td>
クリックとFireEvent "onclick"の両方を試しましたが、実行時エラーが発生します。
どのようなエラーが発生していますか? –
実行時エラー '424'、オブジェクトが必要です。 –
投稿したコード行の各オブジェクトをチェックして、どちらが「Nothing」であるかを確認します。もう少しコードを投稿すると便利です。 –