Option Explicit
Dim IE As SHDocVw.InternetExplorer
Public ctrl_ID As String
Dim Start_Date As Date
Dim k, inx, x, cnt As Integer
Dim link_start As Integer
Dim link_end As Integer
Sub Dowload_MerlinData()
Dim username, password As String
If WebMerlin.Start_Date.Value = "" Then
MsgBox ("please select the date")
Exit Sub
Else
Start_Date = WebMerlin.Start_Date.Value
End If
Application.DisplayAlerts = False
'----------------------Merlin----------------
'username = InputBox("Enter Username (EIN)", "Login")
'password = InputBoxDK("Please enter password", "Login")
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
Application.DisplayAlerts = False
'IE.Navigate "http://ipeipwt7/analytics/"
IE.Navigate "http://merlinng.nat.bt.com/analytics"
Call ie_busy
If WebMerlin.CntModule.Value <> "Performance Reports" Then
IE.Document.forms("Login").elements(0).Value = "607035481"
IE.Document.forms("Login").elements(1).Value = "login012"
Else
IE.Document.forms("Login").elements(0).Value = "607035481"
IE.Document.forms("Login").elements(1).Value = "login012"
End If
IE.Document.forms("Login").submit
Call ie_busy
IE.Document.forms("CMA").elements("YES").Click
Application.DisplayAlerts = False
'sendkeys("y", 1)
Call ie_busy
Call ie_busy
'IE.Document.all.tags("A").Item(Tag_Id("Merlin")).Click
IE.Navigate "http://merlinng.nat.bt.com/analytics/saw.dll?Dashboard&_scid=a90Eg3sCSZI&SearchID=il2cvag8lufdvtqpn4abvhatcq&Page=Saturn%20KPI&PortalPath=/shared/Merlin/_portal/Saturn%20Performance&ViewState=i33qi2mv7sfr7ponb7sjsa4q26&StateAction=NewPage&Done=Dashboard"
Call ie_busy
'IE.Document.all.tags("A").Item(Tag_Id("<CENTER>Merlin")).Click
'Call ie_busy
If WebMerlin.CntModule.Value = "League Tables" Then
IE.Document.all.tags("A").Item(Tag_Id("<CENTER>League Tables")).Click
Call ie_busy
Call ie_busy
ElseIf WebMerlin.CntModule.Value = "Performance Reports" Then
IE.Document.all.tags("A").Item(Tag_Id("<CENTER>Performance Reports ")).Click
Call ie_busy
ElseIf WebMerlin.CntModule.Value = "Login Logout" Then
IE.Document.all.tags("A").Item(Tag_Id("Login Logout")).Click
Call ie_busy
ElseIf WebMerlin.CntModule.Value = "Offline" Then
IE.Document.all.tags("A").Item(Tag_Id("<CENTER>Offline Reports")).Click
Call ie_busy
End If
Windows(WebMerlin.Current_data_book).Activate
' Call ie_busy
' Call fill_hyperlinks
If WebMerlin.CntModule.Value = "League Tables" Then
Call League_Download
ElseIf WebMerlin.CntModule.Value = "Login Logout" Then
Call LoginLogout_Download
ElseIf WebMerlin.CntModule.Value = "Performance Reports" Then
' IE.Document.all.tags("A").Item(124).Click
'MsgBox ("please click :: Apply Saved selection :: & let the menu populate then click Ok")
'Call IE.Document.parentWindow.execScript("buttonMovimenti()", "JavaScript")
'Call ie_busy
'<SPAN class=NQWLeftMenuItemArrow><IMG src="res/sk_oracle10/common/menulftarrow.gif" border=0></SPAN><SPAN class=NQWMenuItemText>Apply Saved Selections</SPAN>
'Call fill_hyperlinks
Call Performance_Download
End If
End Sub