Sub ReleaseTheKraken()
Dim IE As Object
Dim lastRow As Long
Dim i As Variant
Dim PricingRate As Object
Dim EffectiveDate As Object
Dim stupidIframe As HTMLIFrame
Dim savebutton As Object
Dim TariffRate As Object
Dim TariffEffectiveDate As Object
Dim EndDate As Object
lastRow = Range(“A” & Rows.Count).End(xlUp).Row
Set IE = New InternetExplorerMedium
For i = 2 To lastRow
‘Select specific pricing rules to override below
‘below set up to update active and tariff pricing/dates
With IE
.navigate ("http://webprod4/PIM/Pages/ViewProduct/PricingRuleEdit.aspx?Product=usoc&ProductId=" & Cells(i, 1) & "&PricingId=" & Cells(i, 2))
.Visible = True
Do Until IE.readyState <> 4
Loop
Application.Wait (Now + TimeValue(“00:00:03”) / 1.5)
Set stupidIframe = .document.frames("ifAuditTrail").document
Set PricingRate = .document.getElementById("MainContent_ChildMainContent_txPrice")
PricingRate.Value = Cells(i, 3)
Set EffectiveDate = .document.getElementById("MainContent_ChildMainContent_txEffectiveDate")
EffectiveDate.Value = Cells(i, 4)
Set TariffRate = .document.getElementById("MainContent_ChildMainContent_txTariffRate")
TariffRate.Value = Cells(i, 5)
Application.Wait (Now + TimeValue("00:00:02"))
Set TarifEffectiveDate = .document.getElementById("MainContent_ChildMainContent_txTariffEffectiveDate")
TariffEffectiveDate.Value = Cells(i, 6)
Application.Wait (Now + TimeValue("00:00:02"))
'Set EndDate = .document.getElementById("MainContent_ChildMainContent_txEndDate") 'this code is set to remove end date from end dated pricing rules
'EndDate.Value = " "
Application.Wait (Now + TimeValue("00:00:01"))
Set savebutton = .document.getElementById("MainContent_ChildMainContent_btnSave")
savebutton.Focus
savebutton.Click
Application.Wait (Now + TimeValue(“00:00:01”))
End With
Next
MsgBox “The Kraken has been released!”
Call BackUp
End Sub
I’ve tried changing the wait time value but that hasn’t seem to help.
tom Giwa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.