dmcgimpsey
Active Member
- Joined
- Mar 30, 2004
- Messages
- 268
Hi Folks:
I have a web query that routes the results to cell "A1" using a destination clause in the query. What I would like to do is to direct the data into an array named dstarr
Could someone help me with the syntax... I am providing the query I have that outputs to a1, but I need the array declaration and code changes to fill the array with the result.
I tried variant and string but both failed
With ActiveSheet.QueryTables.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1.0;", Destination:=Range("A1"))
.CommandType = 5
.CommandText = Array( _
"<LIST><VIEWGUID>{4CDCDE22-CF6D-4340-BFB2-150D4599E26A}</VIEWGUID><LISTNAME>{49CF708B-DA63-4C78-BF49-33A41ED09ADC}</LISTNAME><LISTWEB>http://wasshr101p/prod/DRRLSA/_vti_bin</LISTWEB><LISTSUBWEB></LISTSUBWEB><ROOTFOLDER>/prod/DRRLSA" _
, "/LSCB</ROOTFOLDER></LIST>")
.Name = "owssvr"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
I have a web query that routes the results to cell "A1" using a destination clause in the query. What I would like to do is to direct the data into an array named dstarr
Could someone help me with the syntax... I am providing the query I have that outputs to a1, but I need the array declaration and code changes to fill the array with the result.
I tried variant and string but both failed
With ActiveSheet.QueryTables.Add(Connection:= _
"OLEDB;Provider=Microsoft.Office.List.OLEDB.1.0;", Destination:=Range("A1"))
.CommandType = 5
.CommandText = Array( _
"<LIST><VIEWGUID>{4CDCDE22-CF6D-4340-BFB2-150D4599E26A}</VIEWGUID><LISTNAME>{49CF708B-DA63-4C78-BF49-33A41ED09ADC}</LISTNAME><LISTWEB>http://wasshr101p/prod/DRRLSA/_vti_bin</LISTWEB><LISTSUBWEB></LISTSUBWEB><ROOTFOLDER>/prod/DRRLSA" _
, "/LSCB</ROOTFOLDER></LIST>")
.Name = "owssvr"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With