S
shart
This is the code so far:
Code:
--------------------
Sub InternetExplorer()
Dim IExp As InternetExplorer
Dim sPage As String
Set IExp = CreateObject("InternetExplorer.Application")
IExp.Visible = True
IExp.Navigate "http://localhost/login?login=demoname&password=demopass"
'Do Until IExp.readyState = READYSTATE_COMPLETE
' DoEvents
'Loop
'IExp.Quit
End Sub
--------------------
I need to click on this link:
Code:
--------------------
<a href="CuO_AAmB/WBPN" title="View stats on sales by item"
onMouseOver="window.status='View stats on sales by item'; return true;" onMouseOut="window.status='';">Sales</a><br>
--------------------
The problem? - The href changes everytime we log into the system, both
before and after the forward-slash ("/"), I am pretty sure it is
Yahoo's way of tracking the session.
From recording macros I know that the link is in table 22, and that it
is the second link in the table. Is there VBA for simply clicking on
the link and then using the page it links to as the data source?
I want to import a table on the page this link links to into excel as a
data source, is there any other way to automate the table import?
Thank You.
Simon.
I have the code excel generates, it pretty much stays the same from
this point, the name is changes to whatever is in to the left of the
"/" in the link above:
Code:
--------------------
Sub Macro1()
'
' Macro1 Macro
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;Http://localhost/login?ag63hresb6fn2&.done=http://storelink/_", _
Destination:=Range("A1"))
.Name = "CuO3wAj_"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "22"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Range("A3").Select
End Sub
Code:
--------------------
Sub InternetExplorer()
Dim IExp As InternetExplorer
Dim sPage As String
Set IExp = CreateObject("InternetExplorer.Application")
IExp.Visible = True
IExp.Navigate "http://localhost/login?login=demoname&password=demopass"
'Do Until IExp.readyState = READYSTATE_COMPLETE
' DoEvents
'Loop
'IExp.Quit
End Sub
--------------------
I need to click on this link:
Code:
--------------------
<a href="CuO_AAmB/WBPN" title="View stats on sales by item"
onMouseOver="window.status='View stats on sales by item'; return true;" onMouseOut="window.status='';">Sales</a><br>
--------------------
The problem? - The href changes everytime we log into the system, both
before and after the forward-slash ("/"), I am pretty sure it is
Yahoo's way of tracking the session.
From recording macros I know that the link is in table 22, and that it
is the second link in the table. Is there VBA for simply clicking on
the link and then using the page it links to as the data source?
I want to import a table on the page this link links to into excel as a
data source, is there any other way to automate the table import?
Thank You.
Simon.
I have the code excel generates, it pretty much stays the same from
this point, the name is changes to whatever is in to the left of the
"/" in the link above:
Code:
--------------------
Sub Macro1()
'
' Macro1 Macro
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;Http://localhost/login?ag63hresb6fn2&.done=http://storelink/_", _
Destination:=Range("A1"))
.Name = "CuO3wAj_"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "22"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Range("A3").Select
End Sub