I need to direct a web query to an array

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
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,224,531
Messages
6,179,384
Members
452,908
Latest member
MTDelphis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top