April 2006
Beginner
1114 pages
98h 16m
English
querytable.WebSelectionType [= xlWebSelectionType]
For web queries, specifies how much of a web page to import. Can be one of these settings:
xlAllTables (default)
xlEntirePage
xlSpecifiedTablesCombine WebSelectionType with the WebTables property to import one or more specific tables from a web page. For example, the following code uses an existing query table to display a real-time quote, omitting unwanted items from the source web page:
Set qt = ActiveSheet.QueryTables(1)
qt.Connection = "URL;http://finance.yahoo.com/q/ecn?s=msft"
qt.Name = "Real-Time Quote"
qt.WebSelectionType = xlSpecifiedTables
qt.WebTables = "22"
qt.WebFormatting = xlWebFormattingNone
qt.BackgroundQuery = True
qt.RefreshInterestingly, you must set WebSelectionType to xlSpecifiedTables before setting the WebTables property or an error occurs at runtime.
Read now
Unlock full access