• ベストアンサー
※ ChatGPTを利用し、要約された質問です(原文:VBAでホームページから値を取得できない)

VBAでホームページから値を取得できない

このQ&Aのポイント
  • VBAでホームページから値を取得できない原因や解決方法についてご教授ください
  • msnマネー残高照会サービスは、各銀行やクレジットカード会社のサイトから預金残高を照会し、個人資産・負債のサマリーを表示させるサービスです
  • VBAを使用してmsnマネー残高照会サービスから資産合計、負債合計、純資産を取得し、メールで送信したいと考えていますが、どの部分から値を取得すればよいのかわかりません

質問者が選んだベストアンサー

  • ベストアンサー
  • DOUGLAS_
  • ベストアンサー率74% (397/534)
回答No.1

Dim strSpan As Object Dim buf As String For Each strSpan In objIE.document.getElementsByTagName("span")  Select Case strSpan.className   Case "aa_assets_plus"    buf = "資産合計:" & strSpan.innerHTML & vbCrLf   Case "red aa_assets_minus"    buf = buf & "負債合計:" & strSpan.innerHTML & vbCrLf   Case "aa_assets"    buf = buf & "純 資 産:" & strSpan.innerHTML  End Select Next MsgBox buf みたいなことで取得できないでしょうか? 「.innerHTML」でダメなら「.innerText」にしてみるとか

daichn1
質問者

お礼

できました! 助かりました、本当にありがとうございました。

全文を見る
すると、全ての回答が全文表示されます。

関連するQ&A

  • VBA エクセルの表をHTML形式のテーブルに変換

    https://tonari-it.com/vba-html-table/ 上記のマクロではCSSが使えない簡単なテーブルタグです。 <table> <tr> <td class=“CSS1”>1</td> <td> <div class=“CSS2”> <div class=“CSS3”> <img> <span class=“CSS4” style="background-image: url(images/abc.png);"></span> </div> <div class=“CSS5”> <div class=“CSS6”>山田 太郎</div> <div class="CSS7”><span>東京</span></div> </div> </div> </td> <td class="CSS8>2000</td> <td class="CSS9”>2000</td> <td class="CSS9”>2000</td> <td class="CSS9”>6000</td> </tr> </table> というふうにやりたいのですが、どうしたら良いでしょうか?

  • CGIPerlクリックした値を次の頁に表示させたい

    下記の様にカレンダーの表をHTMLで作成しました。 それぞれの日付のリンク(○や△)をクリックした時に、 次のページで、クリックした日付を表示させるには、 どのようにすれば良いのでしょうか。 1ページ目 HTMLで作成したカレンダーに、日付と、 それぞれ空き状況○、△、×等を表示。 ○と△はクリック可能。×はクリックできない。 (イメージ)  ―――――― |1 | 2| 3| |○|△|○|  ―――――― 2ページ目構想 日付【1ページ目で○か△をクリックした日付をここに表示したい】 お名前【入力欄】←このページで入力する ご住所【入力欄】←このページで入力する また、この2ページ目の内容は、 sendmailを使用してメール送信する予定でいます。 お名前やご住所の部分をsendmailで送信する事はできるのですが、 その際に、日付の部分も送信できればと考えています。 この点も併せてご教授いただければ幸いに存じます。 以下1ページ目のhtml <html> <body> <table border="1" cellspacing="0"> <tr> <th class="week sun">日</th> <th class="week">月</th> <th class="week">火</th> <th class="week">水</th> <th class="week">木</th> <th class="week">金</th> <th class="week sat">土</th> </tr> <tr> <td class="day">&nbsp;</td> <td class="day">&nbsp;</td> <td class="day">&nbsp;</td> <td class="day">&nbsp;</td> <td class="day before"><span style="color:#000000">1</span><p> <a href="nextpageaddress">○<br>\5,980</a></a></p></td> <td class="day before"><span style="color:#000000">2</span><p> <a href="nextpageaddress">△<br>\5,980</a></a></p></td> <td class="day before"><span style="color:#0000ff">3</span><p> <a href="nextpageaddress">○<br>\5,980</a></a></p></td> </tr> </table> </body> </html> 2ページ目の構想 <html> <table> <tr>     <th>予約日付</th> <td>ここに前ページでクリックした日付を表示させたい</td> </tr><tr> <th>お名前<font color="#ff0000">(必須)</font></th> <td><input type="text" name="お名前" size="35" /></td> </tr><tr> <th>ご住所<font color="#ff0000">(必須)</font></th> <td><input type="text" name="ご住所" size="70" /></td> </tr> </table> </html>

    • ベストアンサー
    • CGI
  • css テーブルについて

    よろしくお願いします。 2だけを300pxと100pxに2分割にできないでしょうか。 <div class="aa"> <table> <tr> <th>1</th> <td>2</td> </tr> <tr> <th>1</th> <td>1</td> </tr> </table> </div> .aa table { width: 500px; height: 100px; border: 1px #000000 solid; border-collapse: collapse; } .aa th { width: 100px; border: 1px #000000 solid; } .aa td { width: 400px; border: 1px #000000 solid; }

    • ベストアンサー
    • CSS
  • VBA IE コンボボックスに値を入れる方法

    こんばんは。 VBAでIEの操作をしています。 --------------------------------------------------------- <tr> <th><span class="asterisk">*</span>&nbsp; <label for="ind">業種:</label></th> <td> <select name="industry" id="ind" tabindex="1800"> <option value="" class="title">[業種を選択]</option> <option value='1'>銀行/金融/不動産 <option value='2'>コンピュータ関係(管理/インターネット) <option value='3'>コンピュータ関係(ハードウエア) </select> </td> </tr> --------------------------------------------------------- 元のソースが↑なのですが、 objIE.document.all("industry")(0).Value = "サービス" としても、[業種を選択]がコンボボックスに投入されてしまいます。 コンボボックスに銀行/金融/不動産を入れる場合は どのようなVBAコードを書けばいいのでしょうか? ご回答よろしくお願いします。

  • table 幅指定でtheadとtbodyがずれる

    bootstrapを使っているのですが、 個別に幅設定がしたいので、htmlに下記を追加しました。 theadは問題なく幅設定できているのですが、tbodyがうまく適用されていないようで theadとずれてしまいます。 theadとtbodyの幅を合わせるにはどのようにすれば良いでしょうか? <style type="text/css"> .scroll1 { width: 1600px; table-layout: fixed; } .scroll1 thead, .scroll1 tbody { float: left; } .scroll1 tbody { height: 350px; overflow-y: scroll; } .c1 { table-layout: fixed;width: 200px; } .c2 { table-layout: fixed;width: 100px; } .c3 { table-layout: fixed;width: 100px; } .c4 { table-layout: fixed;width: 200px; } .c5 { table-layout: fixed;width: 200px; } .c6 { table-layout: fixed;width: 200px; } .c7 { table-layout: fixed;width: 100px; } .c8 { table-layout: fixed;width: 250px; } .c9 { table-layout: fixed;width: 250px; } </style> <table class="table table-bordered table-striped"> <tr> <td> <table border="0" class="table table-bordered table-hover table-striped table-hgroup scroll1"> <thead> <tr style=""> <th class="c1">アクション</th> <th class="c2">店舗コード</th> <th class="c3">ユーザID</th> <th class="c4">ユーザパスワード</th> <th class="c5">ユーザ名</th> <th class="c6">メールアドレス</th> <th class="c7">管理権限</th> <th class="c8">更新日</th> <th class="c9">登録日</th> </tr> </thead> <tbody> <tr style=""> <td style="width:200px;table-layout:fixed"> <input type="submit" value="削除" /> <input type="submit" value="編集" /> </td> <td style="width:100px;table-layout:fixed"> <span >2697</span> </td> <td style="width:100px;table-layout:fixed"> <span >002</span> </td> <td style="width:200px;table-layout:fixed"> <span >000000</span> </td> <td style="width:200px;table-layout:fixed"> <span >大築</span> </td> <td style="width:100px;table-layout:fixed"> <span ></span> </td> <td style="width:100px;table-layout:fixed"> <span >0</span> </td> <td style="width:250px;table-layout:fixed"> <span >2014/11/08 21:20:39</span> </td> <td style="width:250px;table-layout:fixed"> <span >2014/11/08 21:20:48</span> </td> </tr> </tbody> </table> </td> </tr> </table>

    • ベストアンサー
    • CSS
  • 可変長要素を中は左寄せのまま中央寄せ

    widthが可変長の要素があって、その中は左寄せのまま、中央寄せにしたいです。 次のようにテーブルを使えばできたのですが、 テーブルを使わずにやることはできますか?     <style>         .outer{             width:500px;             margin:0 auto;             background:#eee;             text-align:center;         }         .inner{             background:yellow;             margin:0 auto;             text-align:left;         }     </style>     <div class='outer'>         <table class='inner'>             <tr>                 <td>可変長の文字列・・・・・・・・・・</td>             </tr>             <tr>                 <td style='padding:20px 0;'>aaa</td>             </tr>             <tr>                 <td>bbbbbbbbbbbbbb</td>             </tr>         </table>     </div> display:inline-blockを使っても中央寄せにはなりますが、 「行間」の設定が困難でこれではだめでした。 (1行だけならline-heightで設定できるが、複数行になったとき意図したものではなくなる)     <div class='outer' >         <span class='inner' style='display:inline-block'>             <span>可変長の文字列・・・・・・・・・・・・・・</span><br>             <span>「行間」の設定はできないのでだめ</span>         </span>     </div> 宜しくお願いします。

    • ベストアンサー
    • CSS
  • tableセル内の長い文章の後半をカットする方法

     Internet Explorerで表示することを前提に、テーブルのセル内にある長すぎる文章は後半を表示しないようにすることで、すべてのセルをウィンドウの横幅以内に収めたい考えています。  以下のスタイルシートを用いたHTML文章の場合、ブラウザで表示するのであれば、こちらの考えているレイアウトで表示されるのですが、このページを印刷するときは、長い文章の後半は改行されて複数行で表示されてしまいます。 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <style> table{width:100%;border-collapse:collapse;border-width:2px;border-color:black;border-style:solid;} td{border-width:1px 2px 1px 2px;border-style:solid;border-color:black;} th{border:solid 2px black;padding:2mm;background-color:#F0F0F0;} div.t{font-size:5mm;overflow:hidden;height:5mm;margin:1mm;word-break:break-all;} </style> <body> <table> <tbody><tr><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th></tr></tbody><tbody> <tr><td><div class="t">文章テスト文章テスト文章テスト文章テスト文章テスト文章テスト</div></td><td><div class="t">文章テスト文章テスト文章テスト文章テスト文章テスト文章テスト</div></td><td><div class="t">c</div></td><td><div class="t">d</div></td><td><div class="t">e</div></td></tr></tbody><tbody> <tr><td><div class="t">a</div></td><td><div class="t">b</div></td><td><div class="t">c</div></td><td><div class="t">d</div></td><td><div class="t">e</div></td></tr></tbody></table> </body> </html>  印刷時にもセル内の文章が改行されず、かつ、すべてのセルが用紙の横幅に収まる方法をお教えください。

    • ベストアンサー
    • HTML
  • 特定の列の<td>または<th>だけにスタイルを

    かけたいということがあります。 例えば、 ---------------------------------------------------------- <style type="text/css"> .tab1 th, .tab1 td { font-weight:normal; text-align:center; background:#fee; } .tab1 .row2 th { /* ----------------(1) */ background:#fff; } .tab1 .col2 th { /* ----------------(2) */ background:#ffff; } </style> <table class="tab1"> <col class="col1"> <col class="col2"> <col class="col3"> <tr class="row1"> <th>1</th> <th>2</th> <th>3</th> </tr> <tr class="row2"> <th>4</th> <td>5</td> <td>6</td> </tr> <tr class="row3"> <th>7</th> <td>8</td> <td>9</td> </tr> <table> ---------------------------------------------------------- だと、 1 2 3 4 5 6 7 8 9 の中の「4」は(1)により背景が白くなります。 しかし、(2)のようにしても「2」の背景は白くなりません。 <col>ってそういうものなのでしょうか? <td>または<th>にidをつけてスタイルをかけるしかないのでしょうか? よろしくお願いします。

    • ベストアンサー
    • HTML
  • CSS+HTMLでTBODYスクロールさせたい

    「複数行の見出し行(THEAD)で複数行のデータ行(TBODY)をスクロールさせたい」 こんにちわ、HTML+CSSでご質問させていただきます。 ターゲットは、IE7、IE8、IE9です。 http://javascript123.seesaa.net/article/303954410.html を参考に、見出し行固定、のデータスクロールテーブルを cssを使って実現しようと思ってます。 上記URLのサンプルソースをそのままコピーして、 HTMLとして動かすと期待どおりの動きをいたします。 そのサンプルソースの見出し行を複数行にしたく、 以下のように修正いたしましたが、 見出し行2行のうちの1行分しか表示されません。 下記の様になります。 http://apooz.obata.tk/test.html 変更した箇所はtbodyの開始位置をヘッダーの高さ倍にしたかったので、 out_Div内のpadding-topを修正。 あとは、”調査時期”というカラムをTHEADとTBODYに増やしました。 <tr> <th class="coL0" colspan="5">調査時期</th> </tr> 試行錯誤いろいろしましたが、着眼点が悪かったのか、 スキル不足も手伝って、時間ばかり消化しております。 何かヒントなる情報いただけると幸いです。 宜しくお願い致します。 ------------------ソース ここから------------------ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>CSS でヘッダ固定、データ行を スクロールさせるテーブル。</title> <style type="text/css"> <!-- #sclTbl { /* スクロール対象のテーブル */ background-color: #fff; /* テーブルの背景色 borderの色になる */ border-collapse:separate; /* 枠線の表示の仕方 */ font-size: 16px;/* 文字のサイズ */ } #out_Div { /* 全体の枠。ここにヘッダを格納 */ position: relative; /* 相対位置 */ padding-top: 52px; /* #in_Div の開始位置 */ width: 480px; /* 列幅の合計+セル間の幅(2px)の合計+20px 程度 */ border: 1px solid #0099cc; /* 外枠 */ background-color: #fff; /* 白 */ } #in_Div {/* tbodyが入っている。ここがスクロール対象*/ overflow: auto; /* スクロールバー*/ height: 133px; /* tbodyを表示する高さ */ } #sclTbl thead tr {/* ヘッダ 見出し行,位置を #out_Div の左上端に移動 */ position: absolute; /* 絶対位置 */ top: 0px; /* 上からの位置 */ left: 0px; /* 左からの位置 */ background-color: #fff; } #sclTbl thead tr th{/* thead 'th'のスタイル */ background-color: #0099cc; /* 背景色 */ color: #fff; /* 文字色 */ padding: 3px 0px; } #sclTbl tbody tr td{/* tbody 'td'のスタイル */ background-color: #dcdcdd; color: blue; padding: 3px 6px; } .coL0 { width: 30px; }/* colgroupの列幅指定 */ .coL1 { width: 100px; } .coL2 { width: 120px; } --> </style> </head> <body> <div id="out_Div"> <div id="in_Div"> <table id="sclTbl"> <!--colgroup tableの列をグループ化し、列幅指定--> <colgroup class="coL0"></colgroup> <colgroup class="coL1"></colgroup> <colgroup class="coL2"></colgroup> <colgroup class="coL1" span="2"></colgroup> <colgroup class="coL3"></colgroup> <thead> <tr> <th class="coL0" colspan="5">調査時期</th> </tr> <tr> <th class="coL0">No</th> <th class="coL1">都道府県</th> <th class="coL2">県庁所在地</th> <th class="coL1">人口</th> <th class="coL1">面積(km2)</th> </tr> </thead> <tbody> <tr> <td align="center" colspan="5">2011年</td> </tr> <tr> <td>1</td> <td>北海道</td> <td>札幌市</td> <td>5,517,449</td> <td>78,420.61</td> </tr> : (中略) : <tr> <td align="center" colspan="5">2011年</td> </tr> <tr> <td>10</td> <td>群馬県</td> <td>前橋市</td> <td>2,006,903</td> <td>6,363.16</td> </tr> </tbody> </table> </div> </div> </body> </html> ------------------ソースここまで------------------ 大変困ってます。助けてください。m(_ _)m

  • tableのヘッダを固定したい

    IE6,7,8でテーブルのヘッダを固定したいのですが うまくいきません。 条件は以下のとおりです。  ・width: ?%として大きさを可変にする。  ・ヘッダを固定する。  ・ボディにはスクロールバーをつける これまでwidthは固定で作成してきたのですが 可変にする場合どのようなcssにすればよいのでしょうか。 よろしくお願いします。 <div id="container"> <div class="headerTable"> <table border="1" cellspacing="0" cellpadding="0"> <thead> <tr> <th>あ</th> <th>い</th> <th>う</th> <th>え</th> </tr> </thead> </table> </div> <div class="bodyTable"> <table border="1" cellspacing="0" cellpadding="0" width="100%"> <thead> </thead> <tbody> <tr> <td>あaaaaaa</td> <td>い</td> <td>う</td> <td>え</td> </tr> </tbody> </table> </div> </div>