alexanderd
New Member
- Joined
- Feb 1, 2003
- Messages
- 9
i recently found a copy of "Using Web Queries and loop to down load 400 dartabse enteries" which is exactly what i have been looking for., because as you have most likely seen , there is very little dealing with the web and excel.
i have altered your programme because i only have one page to down load.
my problem is that i have to logon and use a password to gain access to the information. can any one suggest a way of achieving this.
i was going to attach a zip file!! i will be back shortly with the code :-
here it is
Sub CreateNewQuery()
' Page 335
Dim WSD As Worksheet
Dim WSW As Worksheet
MyName = "Query"
' ConnectString = "URL;http://www.pma-online.org/scripts/showmemlist.cfm" & MyStr
' ConnectString = "URL;http://www.pma-online.org/scripts/showmemlist.cfm?letter=" & MyStr
'ConnectString = "URL;http://www.searchlightelectric.com/modules/shop/memb_login.asp" & MyStr
ConnectString = "URL;http://www.searchlightelectric.com/modules/shop/fullpricelist.asp" & MyStr
'@@@@@@@@@@@@@@@@
ThisWorkbook.Worksheets.Add
' On the Workspace worksheet, clear all existing query tables
For Each QT In ActiveSheet.QueryTables
QT.Delete
Next QT
' Define a new Web Query
Set QT = ActiveSheet.QueryTables.Add(Connection:=ConnectString, Destination:=Range("A1"))
With QT
.Name = MyName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = "7"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
End With
' Refresh the Query
QT.Refresh BackgroundQuery:=True
End Sub
(
07 Sep 2005 19:02
i have altered your programme because i only have one page to down load.
my problem is that i have to logon and use a password to gain access to the information. can any one suggest a way of achieving this.
i was going to attach a zip file!! i will be back shortly with the code :-
here it is
Sub CreateNewQuery()
' Page 335
Dim WSD As Worksheet
Dim WSW As Worksheet
MyName = "Query"
' ConnectString = "URL;http://www.pma-online.org/scripts/showmemlist.cfm" & MyStr
' ConnectString = "URL;http://www.pma-online.org/scripts/showmemlist.cfm?letter=" & MyStr
'ConnectString = "URL;http://www.searchlightelectric.com/modules/shop/memb_login.asp" & MyStr
ConnectString = "URL;http://www.searchlightelectric.com/modules/shop/fullpricelist.asp" & MyStr
'@@@@@@@@@@@@@@@@
ThisWorkbook.Worksheets.Add
' On the Workspace worksheet, clear all existing query tables
For Each QT In ActiveSheet.QueryTables
QT.Delete
Next QT
' Define a new Web Query
Set QT = ActiveSheet.QueryTables.Add(Connection:=ConnectString, Destination:=Range("A1"))
With QT
.Name = MyName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = "7"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
End With
' Refresh the Query
QT.Refresh BackgroundQuery:=True
End Sub
(
07 Sep 2005 19:02