Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 224
Default Web query and carriage returns

When I do a web query on an html table, any carriage returns in the
html table cells are treated as row delimiters.

For example, if a single cell in the html table looks like this:

Before Carriage Return
After Carriage Return

Then that cell gets imported to two worksheet rows.

Is there any way to get it to import each html table cell into a
single worksheet cell?



Here's what I'm doing:



Function DownloadTableFromWebByConnStr(dest_range As Range,
connection_string As String) As Boolean

'returns True on success.

Dim strConnection As String
Dim qtQueryTable As QueryTable
Dim bDisplayAlertsStatus As Boolean


bDisplayAlertsStatus = Application.DisplayAlerts
Application.DisplayAlerts = False


Set qtQueryTable =
dest_range.Parent.QueryTables.Add(connection_strin g,
Destination:=dest_range)

With qtQueryTable
.Name = "Full International Table"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False 'True 'False
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables 'xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
' .WebTables = "1"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

qtQueryTable.Delete

Call FixBooleansAfterImport(dest_range)

Application.DisplayAlerts = bDisplayAlertsStatus

DownloadTableFromWebByConnStr = True

End Function


Thanks,

Greg

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Carriage returns - how to get rid of them (again) Andrewsan Excel Discussion (Misc queries) 8 March 28th 07 10:15 AM
Carriage returns in the formula bar? rubeus Excel Worksheet Functions 4 July 6th 06 06:05 PM
Delete Carriage Returns Andre Excel Discussion (Misc queries) 2 December 1st 05 09:50 PM
Carriage returns tracyt620 Excel Discussion (Misc queries) 1 July 7th 05 02:52 PM
Replacing Carriage Returns David Excel Programming 1 November 26th 03 04:01 PM


All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"