Name
querytable.WebSingleBlockTextImport [= setting]
Synopsis
For web queries, True parses rows in <PRE> (preformatted) sections as a single block; False parses contiguous rows in <PRE> sections as blocks. Default is True.
This property is useful if a single <PRE> section contains multiple blocks of preformatted data that use different column alignment. For example, the following code imports a sample web page and parses contiguous rows within <PRE> blocks individually:
Set qt = ActiveSheet.QueryTables(1)
qt.Connection = "URL;file://" & ThisWorkbook.Path & "\preblocks.html"
qt.WebPreFormattedTextToColumns = True
qt.WebSingleBlockTextImport = False
qt.RefreshThe web page containing items parsed into cells looks like this:
<html>
<body>
<pre>
Col1 Col2 Col3 Col4
1 2 3 4
5 6 7 8
c1 c2 c3 c4
1 2 3 4
5 6 7 8
</pre>
</body>
</html>The preceding code results in two blocks of data, each with four columns. If WebSingleBlockTextImport were set to True instead, the second table would contain only one column of data.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access