Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub tset()
- Dim ieObject As Object: Set ieObject = CreateObject("InternetExplorer.Application")
- CreateObject("WScript.Shell").AppActivate "Internet Explorer"
- With ieObject
- .Navigate "https://partners.subway.com/"
- .Visible = True
- Do While (.Busy Or .READYSTATE <> 4)
- Application.Wait (Now + TimeValue("0:00:10"))
- Loop
- Dim ieUser: Set ieUser = .Document.GetElementByID("dnn_ctr370_Login_Login_DNN_txtUsername")
- Dim iePass: Set iePass = .Document.GetElementByID("dnn_ctr370_Login_Login_DNN_txtPassword")
- Dim ieButt: Set ieButt = .Document.GetElementByID("dnn_ctr370_Login_Login_DNN_cmdLogin")
- If IsObject(ieUser) And IsObject(iePass) And IsObject(ieButt) Then
- ieUser.Value = "Colin34124"
- iePass.Value = "Robert469"
- ieButt.Click
- End If
- Do While (.Busy Or .READYSTATE <> 4)
- Application.Wait (Now + TimeValue("0:00:10"))
- Loop
- .Navigate "https://liveiq.subway.com/Reporting/Content.aspx?action=daily&entityType=store&entityId=BBW4srKMGbM%3d"
- Do While (.Busy Or .READYSTATE <> 4)
- Application.Wait (Now + TimeValue("0:00:10"))
- Loop
- ' New Code can be added to your existing script
- .Navigate "https://liveiq.subway.com/Reporting/Forms/ReportViewer.aspx?entityId=nRYWBAZnwNM~&entityType=store&extractReportId=HCK9b3rfRdM~&factor=590"
- Do While (.Busy Or .READYSTATE <> 4)
- Application.Wait (Now + TimeValue("0:00:5"))
- Loop
- Set oDoc = .Document
- With oDoc
- Dim oReg As Object
- Set oReg = CreateObject("VBScript.RegExp")
- With oReg
- .Pattern = "(\/Reporting\/Reserved\.ReportViewerWebControl\.axd\?ReportSession=(\w*\d*)&ControlID=(\w*\d*))"
- .Global = True
- .IgnoreCase = True
- .MultiLine = True
- End With
- rcsid = False
- For Each elem In .getElementsByTagName("script")
- If oReg.Test(elem.innerText) Then
- Set matches = oReg.Execute(elem.innerText)
- rcsid = matches.Item(0)
- Exit For
- End If
- Next
- End With
- .Navigate "https://liveiq.subway.com/Reporting/Reserved.ReportViewerWebControl.axd?" & rcsid & "&Culture=1033&UICulture=1033&ReportStack=1&OpType=Export&FileName=Combo&ContentDisposition=OnlyHtmlInline&Format=EXCELOPENXML"
- ' ^^ New Code can be added to your existing script
- Application.Wait (Now + TimeValue("0:00:5"))
- .Quit
- End With
- Set ieObject = Nothing
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement