Excelのファイルから特定のIEにデータを送信しますオブジェクトは事前定義されています。vbaを使って外部IEオブジェクトにEnterキー(〜)を送ります
データは、マクロを使用してtextareaフィールド(ID:id1を介してウェブサイトに識別される)でウェブサイトに送信されます。ウェブサイトのtextareaフィールドに追加された各セルの値/データについてEnterキー/コマンドは自動的に完了/追加する必要があります。これにより、空の入力フィールドの一部がWebサイトに自動的に完成します(コードは以下に記載されています:)
私は自動的にデータが更新
コードを挿入された後のテキストエリアにウェブサイトにENTERキーを送信する方法に苦しんだ。..
Sub adddata()
Dim objIE As Object
Dim objTR As Object
Dim i, j, counter As Integer
Dim lastRow As Long
counter = 1
Set objIE = GetIeByTitle("https://exampletest.com", True, True)
Dim lastRow2 As Integer
lastRow2 = Workbooks(path1).Worksheets("Test").Range("A" & Rows.Count).End(xlUp).Row
Workbooks(path1).Worksheets("Test").Activate
contor = 1
'First of all the unhidden files have to be take from the target excel file
'Selecting the unhidden lines from the excel file
For j = 1 To lastRow2
If Rows(j).EntireRow.Hidden = False Then
Workbooks(path1).Worksheets("Test").Range("A" & j & ":Z" & j).Select
Selection.Copy
ThisWorkbook.Worksheets("Test2").Range("A" & counter).PasteSpecial
counter = counter + 1
End If
Next j
'look into the new excel file containing just the unhidden lines
'Afterwards a look up through new excel file cells
For i = 2 To counter
objIE.document.getelementbyid("id1").Value = Worksheets("Test2").Range("C" & i).Value ' taking the value from the cell and adding it on the text area field
objIE.document.getelementbyid("id1").SetFocus
Application.SendKeys "~" ' sending the enter key
Application.Wait (7) ' add the delay of 7 seconds
'2nd field
objIE.document.getelementbyid("id2").Value = Worksheets("Test2").Range("D" & i).Value
'3rd field
objIE.document.getelementbyid("id3").Value = Worksheets("Test2").Range("E" & i).Value
Next i
End Sub
これは実際のコードですか?それはコンパイルされません... –