質問編集履歴
2
解決いたしました
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,131 +8,4 @@
|
|
8
8
|
商品コードをセルから取り出し貼り付け
|
9
9
|
問い合わせボタンを押す
|
10
10
|
↓
|
11
|
-
出力された情報をエクセルへ貼り付け
|
11
|
+
出力された情報をエクセルへ貼り付け
|
12
|
-
|
13
|
-
|
14
|
-
###発生している問題・エラーメッセージ
|
15
|
-
在庫確認ページへアクセスすると、framesetが2つ表示となっており、
|
16
|
-
実際の商品コードで問い合わせたいページはstock.aspとなっている。
|
17
|
-
|
18
|
-
stock.aspへ直接アクセスしようとすると、index.htmlへ強制的に飛ばされる。
|
19
|
-
|
20
|
-
「アプリケーション定義またはオブジジェクト定義のエラーです。
|
21
|
-
データ型を数値もしくは文字列形に変更すると、
|
22
|
-
「コンパイルエラー オブジェクトが必要です。」
|
23
|
-
となります。
|
24
|
-
実際に代入される値は文字列なのですが・・・。
|
25
|
-
ここではどれを入れればよろしいのでしょうか・・・。
|
26
|
-
(integer long object string variantはすべて試しました。)
|
27
|
-
|
28
|
-
###該当のソースコード
|
29
|
-
<該当HTML>
|
30
|
-
□在庫確認ページ
|
31
|
-
<html>
|
32
|
-
<head>
|
33
|
-
<title>- ********************* -</title>
|
34
|
-
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
|
35
|
-
</head>
|
36
|
-
|
37
|
-
<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
|
38
|
-
<frame name="topFrame" scrolling="NO" noresize src="stock_head.html" marginwidth="0" marginheight="0">
|
39
|
-
<frame name="mainFrame" src="stock.asp" marginwidth="0" marginheight="0"></frameset>
|
40
|
-
|
41
|
-
<noframes>
|
42
|
-
<body bgcolor="#FFFFFF" text="#000000">
|
43
|
-
</body>
|
44
|
-
</noframes>
|
45
|
-
|
46
|
-
</html>
|
47
|
-
□stock.aspのページ
|
48
|
-
<body style="background:white url(*********************.gif) no-repeat top left;" text="#000000">
|
49
|
-
<table width="744" border="0" cellspacing="0" cellpadding="0" align="center">
|
50
|
-
<tr><td>
|
51
|
-
<table width="605" border="0" align="center">
|
52
|
-
<tr><td height="80"> </td></tr>
|
53
|
-
|
54
|
-
'=================================下記からが触りたい部分です。============================
|
55
|
-
<tr>
|
56
|
-
<td align="right">
|
57
|
-
<table style="width:600px;" border="1" cellspacing="0" cellpadding="2" bordercolor="#000000" bordercolorlight="#FFFFFF" bgcolor="#FFFFFF">
|
58
|
-
<form method="post" action="stock.asp">
|
59
|
-
<tr>
|
60
|
-
<td bgcolor="#FF9999" style="width:100px;" class="j14">商品コード</td>
|
61
|
-
<td colspan="2" style="width:200px;">
|
62
|
-
<input type="text" name="txtSyohincd" size="15" value="" maxlength="12" style="width:100px;">
|
63
|
-
<input type="submit" value="問合せ" name="cmdQuery" class="j12">
|
64
|
-
</td>
|
65
|
-
<td bgcolor="#FF9999" style="width:100px;" class="j14">メーカー品番</td>
|
66
|
-
<td colspan="2" style="width:200px"><br></td>
|
67
|
-
</tr>
|
68
|
-
<tr>
|
69
|
-
<td bgcolor="#FF9999" class="j14">商品名称</td>
|
70
|
-
<td colspan="5"><br></td>
|
71
|
-
</tr>
|
72
|
-
<tr>
|
73
|
-
<td bgcolor="#FF9999" style="width:100px;" class="j14">単位</td>
|
74
|
-
<td style="width:100px;"><br></td>
|
75
|
-
<td bgcolor="#FF9999" style="width:100px;" class="j14">在庫数</td>
|
76
|
-
<td style="width:100px;"><br></td>
|
77
|
-
<td bgcolor="#FF9999" style="width:100px;" class="j14">標準納期(日)</td>
|
78
|
-
<td style="width:100px;"><br></td>
|
79
|
-
</tr>
|
80
|
-
<tr>
|
81
|
-
<td bgcolor="#FF9999" class="j14">定価</td>
|
82
|
-
<td><br></td>
|
83
|
-
<td bgcolor="#FF9999" class="j14">仕切率(%)</td>
|
84
|
-
<td><br></td>
|
85
|
-
<td bgcolor="#FF9999" class="j14">送料</td>
|
86
|
-
<td><br></td>
|
87
|
-
</tr>
|
88
|
-
<tr>
|
89
|
-
<td bgcolor="#FF9999" class="j14">仕切値</td>
|
90
|
-
<td colspan="5"><br></td>
|
91
|
-
</tr>
|
92
|
-
<tr>
|
93
|
-
<td bgcolor="#FF9999" class="j14">備考</td>
|
94
|
-
<td colspan="5"><br></td>
|
95
|
-
</tr>
|
96
|
-
</form>
|
97
|
-
</table>
|
98
|
-
'=================================ここまでです。=================================
|
99
|
-
|
100
|
-
</td>
|
101
|
-
</tr>
|
102
|
-
</table>
|
103
|
-
</td>
|
104
|
-
</tr>
|
105
|
-
<tr>
|
106
|
-
<td> </td>
|
107
|
-
</tr>
|
108
|
-
<tr>
|
109
|
-
<td bgcolor="#EF962F" height="1"><img src="image/head/spacer.gif" width="605" height="1"></td>
|
110
|
-
</tr>
|
111
|
-
</table>
|
112
|
-
</body>
|
113
|
-
|
114
|
-
<該当VBA>
|
115
|
-
'フレーム情報取得
|
116
|
-
Dim objFRAME As FramesCollection
|
117
|
-
Set objFRAME = objIE.Document.frames
|
118
|
-
|
119
|
-
Dim objDOC As HTMLDocument
|
120
|
-
Set objDOC = objFRAME("mainFrame").Document
|
121
|
-
|
122
|
-
'ページ表示待機
|
123
|
-
waitTime = Now + TimeValue("0:00:01")
|
124
|
-
Application.Wait waitTime
|
125
|
-
|
126
|
-
'商品コードを入力
|
127
|
-
Dim txtInput As String
|
128
|
-
Set txtInput = objDOC.getElementsByName("txtSyohincd")
|
129
|
-
txtInput.Value = Cells(i, 2)
|
130
|
-
|
131
|
-
|
132
|
-
<環境>
|
133
|
-
Windows7 Professional 32bit
|
134
|
-
Microsoft Office 2010 Excel
|
135
|
-
Internet Explorer 11
|
136
|
-
|
137
|
-
3/8変更しました。
|
138
|
-
よろしくお願いいたします。
|
1
確認したところ、IE側でFrameが使用されておりましたので、問題箇所を明確にしました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,20 +1,138 @@
|
|
1
1
|
###前提・実現したいこと
|
2
|
+
在庫数確認のため、WEBページにアクセス
|
3
|
+
↓
|
4
|
+
ログイン
|
5
|
+
↓
|
6
|
+
在庫確認ページへアクセス
|
7
|
+
↓
|
2
|
-
|
8
|
+
商品コードをセルから取り出し貼り付け
|
9
|
+
問い合わせボタンを押す
|
10
|
+
↓
|
3
|
-
|
11
|
+
出力された情報をエクセルへ貼り付け
|
4
12
|
|
13
|
+
|
5
14
|
###発生している問題・エラーメッセージ
|
15
|
+
在庫確認ページへアクセスすると、framesetが2つ表示となっており、
|
6
|
-
|
16
|
+
実際の商品コードで問い合わせたいページはstock.aspとなっている。
|
7
17
|
|
18
|
+
stock.aspへ直接アクセスしようとすると、index.htmlへ強制的に飛ばされる。
|
19
|
+
|
20
|
+
「アプリケーション定義またはオブジジェクト定義のエラーです。
|
21
|
+
データ型を数値もしくは文字列形に変更すると、
|
22
|
+
「コンパイルエラー オブジェクトが必要です。」
|
23
|
+
となります。
|
24
|
+
実際に代入される値は文字列なのですが・・・。
|
25
|
+
ここではどれを入れればよろしいのでしょうか・・・。
|
26
|
+
(integer long object string variantはすべて試しました。)
|
27
|
+
|
8
28
|
###該当のソースコード
|
9
29
|
<該当HTML>
|
30
|
+
□在庫確認ページ
|
31
|
+
<html>
|
32
|
+
<head>
|
33
|
+
<title>- ********************* -</title>
|
10
|
-
<
|
34
|
+
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
|
35
|
+
</head>
|
11
36
|
|
37
|
+
<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
|
38
|
+
<frame name="topFrame" scrolling="NO" noresize src="stock_head.html" marginwidth="0" marginheight="0">
|
39
|
+
<frame name="mainFrame" src="stock.asp" marginwidth="0" marginheight="0"></frameset>
|
40
|
+
|
41
|
+
<noframes>
|
42
|
+
<body bgcolor="#FFFFFF" text="#000000">
|
43
|
+
</body>
|
44
|
+
</noframes>
|
45
|
+
|
46
|
+
</html>
|
47
|
+
□stock.aspのページ
|
48
|
+
<body style="background:white url(*********************.gif) no-repeat top left;" text="#000000">
|
49
|
+
<table width="744" border="0" cellspacing="0" cellpadding="0" align="center">
|
50
|
+
<tr><td>
|
51
|
+
<table width="605" border="0" align="center">
|
52
|
+
<tr><td height="80"> </td></tr>
|
53
|
+
|
54
|
+
'=================================下記からが触りたい部分です。============================
|
55
|
+
<tr>
|
56
|
+
<td align="right">
|
57
|
+
<table style="width:600px;" border="1" cellspacing="0" cellpadding="2" bordercolor="#000000" bordercolorlight="#FFFFFF" bgcolor="#FFFFFF">
|
58
|
+
<form method="post" action="stock.asp">
|
59
|
+
<tr>
|
60
|
+
<td bgcolor="#FF9999" style="width:100px;" class="j14">商品コード</td>
|
61
|
+
<td colspan="2" style="width:200px;">
|
62
|
+
<input type="text" name="txtSyohincd" size="15" value="" maxlength="12" style="width:100px;">
|
63
|
+
<input type="submit" value="問合せ" name="cmdQuery" class="j12">
|
64
|
+
</td>
|
65
|
+
<td bgcolor="#FF9999" style="width:100px;" class="j14">メーカー品番</td>
|
66
|
+
<td colspan="2" style="width:200px"><br></td>
|
67
|
+
</tr>
|
68
|
+
<tr>
|
69
|
+
<td bgcolor="#FF9999" class="j14">商品名称</td>
|
70
|
+
<td colspan="5"><br></td>
|
71
|
+
</tr>
|
72
|
+
<tr>
|
73
|
+
<td bgcolor="#FF9999" style="width:100px;" class="j14">単位</td>
|
74
|
+
<td style="width:100px;"><br></td>
|
75
|
+
<td bgcolor="#FF9999" style="width:100px;" class="j14">在庫数</td>
|
76
|
+
<td style="width:100px;"><br></td>
|
77
|
+
<td bgcolor="#FF9999" style="width:100px;" class="j14">標準納期(日)</td>
|
78
|
+
<td style="width:100px;"><br></td>
|
79
|
+
</tr>
|
80
|
+
<tr>
|
81
|
+
<td bgcolor="#FF9999" class="j14">定価</td>
|
82
|
+
<td><br></td>
|
83
|
+
<td bgcolor="#FF9999" class="j14">仕切率(%)</td>
|
84
|
+
<td><br></td>
|
85
|
+
<td bgcolor="#FF9999" class="j14">送料</td>
|
86
|
+
<td><br></td>
|
87
|
+
</tr>
|
88
|
+
<tr>
|
89
|
+
<td bgcolor="#FF9999" class="j14">仕切値</td>
|
90
|
+
<td colspan="5"><br></td>
|
91
|
+
</tr>
|
92
|
+
<tr>
|
93
|
+
<td bgcolor="#FF9999" class="j14">備考</td>
|
94
|
+
<td colspan="5"><br></td>
|
95
|
+
</tr>
|
96
|
+
</form>
|
97
|
+
</table>
|
98
|
+
'=================================ここまでです。=================================
|
99
|
+
|
100
|
+
</td>
|
101
|
+
</tr>
|
102
|
+
</table>
|
103
|
+
</td>
|
104
|
+
</tr>
|
105
|
+
<tr>
|
106
|
+
<td> </td>
|
107
|
+
</tr>
|
108
|
+
<tr>
|
109
|
+
<td bgcolor="#EF962F" height="1"><img src="image/head/spacer.gif" width="605" height="1"></td>
|
110
|
+
</tr>
|
111
|
+
</table>
|
112
|
+
</body>
|
113
|
+
|
12
114
|
<該当VBA>
|
115
|
+
'フレーム情報取得
|
116
|
+
Dim objFRAME As FramesCollection
|
13
|
-
|
117
|
+
Set objFRAME = objIE.Document.frames
|
14
118
|
|
119
|
+
Dim objDOC As HTMLDocument
|
120
|
+
Set objDOC = objFRAME("mainFrame").Document
|
121
|
+
|
122
|
+
'ページ表示待機
|
123
|
+
waitTime = Now + TimeValue("0:00:01")
|
124
|
+
Application.Wait waitTime
|
125
|
+
|
126
|
+
'商品コードを入力
|
127
|
+
Dim txtInput As String
|
128
|
+
Set txtInput = objDOC.getElementsByName("txtSyohincd")
|
129
|
+
txtInput.Value = Cells(i, 2)
|
130
|
+
|
131
|
+
|
15
132
|
<環境>
|
16
133
|
Windows7 Professional 32bit
|
17
|
-
|
134
|
+
Microsoft Office 2010 Excel
|
18
|
-
|
135
|
+
Internet Explorer 11
|
19
136
|
|
137
|
+
3/8変更しました。
|
20
138
|
よろしくお願いいたします。
|