| 
    
     |  | お世話になります。 
 ie制御マクロで困っているので教えていただければ幸いです。
 
 下記のマクロ1は動きます
 -----------------------------------------------------------
 
 Sub マクロ1()
 
 現在位置列 = ActiveCell.Column
 現在位置行 = ActiveCell.Row
 
 Dim objIE As Object
 Set objIE = CreateObject("InternetExplorer.Application")
 objIE.Visible = True 'IE可視
 
 objIE.Navigate (ActiveCell.Value)
 
 While objIE.ReadyState <> 4 Or objIE.Busy = True
 DoEvents
 Wend
 
 objIE.Document.all("account").Value = Cells(現在位置行, 7)
 objIE.Document.all("login_act").Click
 
 While objIE.ReadyState <> 4 Or objIE.Busy = True
 DoEvents
 Wend
 
 objIE.Quit
 
 
 End Sub
 ----------------------------------------------------------
 これにエンターを押すまで待機させるようにマクロを教えていただきました。
 ----------------------------------------------------------
 Option Explicit
 Private Declare Function GetAsyncKeyState Lib "User32.dll" _
 (ByVal vKey As Long) As Long
 Private Declare Sub Sleep Lib "kernel32" _
 (ByVal dwMilliseconds As Long)
 Private Const VK_RETURN = &HD
 
 Sub マクロ1()
 Dim 現在位置列 As Long
 Dim 現在位置行 As Long
 Dim objIE As Object '変数定義
 Dim r
 Dim time10
 Dim Document
 
 Set objIE = CreateObject("InternetExplorer.Application") 'object作成
 objIE.Visible = True 'IE可視
 objIE.Navigate (ActiveCell.Value)
 
 While objIE.ReadyState <> 4 Or objIE.Busy = True
 DoEvents
 Wend
 
 objIE.Document.all("account").Value = Cells(現在位置行, 7)
 objIE.Document.all("login_act").Click
 
 While objIE.ReadyState <> 4 Or objIE.Busy = True
 DoEvents
 Wend
 
 Do
 DoEvents
 If GetAsyncKeyState(VK_RETURN) <> 0 Then Exit Do
 Sleep (10)
 Loop
 While objIE.ReadyState <> 4 Or objIE.Busy = True
 DoEvents
 Wend
 
 objIE.Quit
 
 End Sub
 --------------------------------------------------
 この形にするとobjIE.Document.all("account").Value = Cells(現在位置行, 7) で止まってしまいます。
 objIE.Document.all("account").Value = Cells(現在位置行, 7) を削ると正常に動きます。
 
 初歩的な質問なのかもしれませんがobjIE.Document.all("account").Value = Cells(現在位置行, 7) を正常に記入出来るように教えていただけないでしょうか?
 よろしくお願いいたします。
 
 |  |