액세스 2016 : 코드가 작동하고 정말 멋지다! 그러나 첫 번째 레코드에 대해서만 반복됩니다. 나는 2 일 동안 루프 코드를 추가/이동하지 않고 보냈다.첫 액세스 기록에 집착 한 웹 페이지를 업데이트하는 액세스 루프
내가 작동하게되면 : Browser = False. 업데이트 프로세스를보기 위해 카운터를 추가 할 계획입니다.
또한 이베이의 서버가 데이터를 충분히 빠르게 처리 할 수없는 경우 루프 일시 중지를 추가해야 할 수도 있습니다.
코드 : (나는 밖으로 몇 줄을 떠 났어요 ...하지만 주요 코드는 좋다) 내가 여기에 코드를 확인
Private Sub ReviseSKUAll_Click()
Dim btnUpdate As MSHTML.HTMLInputElement
Dim rst As DAO.Recordset
Dim dbs As DAO.Database
Dim strSQL As String
Dim intI As Integer
Dim skuNumber As Object
Dim IE As Object
Set dbs = CurrentDb
'-------------------------------------------------------------------------
------------------------------------------
'Begin Loop
strSQL = "SELECT Inventory.[Item ID] FROM Inventory"
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
'If the recordset is empty, exit.
If rst.EOF Then Exit Sub
intI = intI + 1
'intI = 1
rst.MoveLast
rst.MoveFirst
With rst
Do Until .EOF
'-------------------------------------------------------------------------
'--------------------------------------------
Set IE = CreateObject("InternetExplorer.Application")
With IE
.top = 0
.Left = 0
.Height = 1000
.Width = 1250
.Visible = True
.Navigate " ""
Do While .Busy Or Not .ReadyState = 4: DoEvents: Loop
Do Until .Document.ReadyState = "complete": DoEvents: Loop
Set AllHyperlinks = IE.Document.getElementsByTagName("A")
For Each hyper_link In AllHyperlinks
If hyper_link.innerText = "editpane_skuNumber" Then
hyper_link.Click
Exit For
End If
Next
'eBays Page Sku info
'">
Call .Document.getElementById("editpane_skuNumber").setAttribute("value",
(Nz([CustomLabelCombine]) & " " & (Nz("Location" & " " & [Location])
& " " & (Nz("Bin" & " " & [Bin])))))
Set AllHyperlinks = IE.Document.getElementsByTagName("A")
Set AllHyperlinks = IE.Document.getElementsByTagName("A")
For Each hyper_link In AllHyperlinks
If hyper_link.innerText = "pbtn" Then
hyper_link.Click
Exit For
End If
Next
End With
With IE.Document
'eBays Update Listing Button Push
'<input class="pbtn" type="button" value="Update listing" fn="pub">
Set elems = .getElementsByTagName("input")
For Each e In elems
If (e.getAttribute("value") = "Update listing") Then
e.Click
Exit For
End If
Next e
IE.Quit
Set IE = Nothing
'eBays Close Listing Button Push
'<input class="pbtn" type="button" value="Close" fn="clsRv">
'----------------------------------------------------------------------
'End Loop
rst.MoveNext
End With
Loop
End With
'----------------------------------------------------------------------
End Sub
GeoffreyG, 당신은 매우 도움이되었고 나에게 내가 생각하지 못한 길을주었습니다. 나는 모든 코드를 공개적으로 제공 할 수 없다는 것을 이해하면 좋겠다. 그렇게하면 모든 eBay 목록이 손상 될 수 있기 때문이다. 고마워, Bill – EbayBill
비슷한 문제가있는 사람이라면'While Me.CurrentRecord'와'Me.Recordset.MoveNext'로 루프를 만들 수 있었지만, 10 개 정도의 업데이트 된 페이지 이후 eBay 웹 페이지 오류가 발생하여 루프 간 일시 중지. 도와 주신 GeoffreyG에게 다시 한 번 감사드립니다. –
EbayBill