Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

WebSelectionType Property [Excel 2003 VBA Language Reference]

Office 2003

XlWebSelectionType can be one of these XlWebSelectionType constants.
xlEntirePage
xlAllTables default.
xlSpecifiedTables

expression.WebSelectionType

expression Required. An expression that returns one of the objects in the Applies To list.

Remarks

Use this property only when the query table's QueryType property is set to xlWebQuery and the query returns an HTML document.

If the value of this property is xlSpecifiedTables, you can use the WebTables property to specify the tables to be imported.

Example

This example adds a new Web query table to the first worksheet in the first workbook and then imports data from the first and second tables in the Web page.

Set shFirstQtr = Workbooks(1).Worksheets(1) 
Set qtQtrResults = shFirstQtr.QueryTables _
    .Add(Connection := "URL;http://datasvr/98q1/19980331.htm", _
        Destination := shFirstQtr.Cells(1,1))
With qtQtrResults
    .WebFormatting = xlNone
    .WebSelectionType = xlSpecifiedTables
    .WebTables = "1,2"
    .Refresh
End With
		


Applies to | QueryTable Object


Show:
© 2015 Microsoft