0

要件に従って、すべてを実行するコードをいくつか書きました。私が問題を抱えている領域は、フォームの 1 つに対して Excel から入力を取得していないことです。

ページの HTML の画像も添付しました。 ここに画像の説明を入力

Sub Appreciation()
Dim LastRow As Long
Dim IE As InternetExplorer
Dim aEle As HTMLLinkElement
Dim y As Integer
Dim reslt As String
Dim objCollection As Object
Dim doc As HTMLDocument

Dim sht As Worksheet
Set sht = ThisWorkbook.Sheets("data")

Dim i As Long

LastRow = sht.Cells(sht.Rows.count, "A").End(xlUp).Row

'Open link
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "https://some link"
Do
DoEvents
Loop Until IE.readyState = 4
'Open customer section
Set allhyperlink = IE.document.getElementsByTagName("A")

For Each hyper_link In allhyperlink
If hyper_link.innerText = "Add Range" Then
hyper_link.Click
Exit For
End If
Next
'linking excel
Application.Wait (Now + TimeValue("0:00:4"))

Worksheets("data").Activate
For i = 2 To LastRow   'loop
Set doc = IE.document
   IE.document.getElementById("designation").Value = 
ThisWorkbook.Sheets("data").Range("C" & i)
IE.document.getElementById("token-input-tags").Value = 
ThisWorkbook.Sheets("data").Range("F" & i)  'tags

IE.document.getElementById("frmaddcards").Value = 
ThisWorkbook.Sheets("data").Range("A" & i)
IE.document.getElementById("logopicture").Click
IE.document.getElementById("FileInput").Click


 'This is where i have problem
 doc.getElementsByClassName("cke_editable cke_editable_themed 
 cke_contents_ltr cke_show_borders")(0).Value = "ct"    'i have also 
 tried with (0), (1)...so on and also without defining the index

 Next i

 End Sub
4

0 に答える 0