Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default HTML string not formatting when copied into sheet

Hello All,

Any help with the following would be greatly appreciated.

I've got a two column table in SQLserver - second field contains a
long string - this string is HTML code.

Lets say there's only one record in the table and the HTML looks like
the following:
<htmlhelloworld</html

If I SELECT * from the table and then right click the contents in
SQLserver Results pain, and then paste into a worksheet, it just says
helloworld in a cell - with no tags. So I assumed if I moved this info
to Excel using ADO in my VBA then it would appear formatted
correctly.

If I use ADO with code like the following then it just appears as one
string in the cell with all the tags visible!! Anyone ever come across
this before ?

Help much appreciated
Jason.

'======================
rsExcel.MoveFirst
Do Until rsExcel.EOF

Excel.ThisWorkbook.Sheets("XXX").Copy
Befo=Excel.ThisWorkbook.Sheets("XXX")
Excel.ActiveSheet.Name = rsExcel!Game

With rsHTML
'Extract and copy the required records
.Open "SELECT myHTML" & _
" FROM WHAnalysis.dbo.tb_xxx_jq" & _
" WHERE Game= '" & rsExcel!yyy & "'"
Excel.ActiveSheet.Range("C2").CopyFromRecordset rsHTML
.Close 'close connection
End With

rsExcel.MoveNext
Loop
'======================
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
When a sheet is copied, i want also that the Sub's whithin this sheet is copied to the new sheet Luc[_8_] Excel Programming 2 January 12th 10 05:49 AM
Deleting Objects all at once - (copied HTML to excel) coastal Excel Discussion (Misc queries) 4 June 26th 07 08:26 PM
saving website html as string [email protected] Excel Programming 0 June 9th 06 06:34 PM
fixed string length,even other record is copied viv Excel Discussion (Misc queries) 0 May 30th 05 08:28 PM


All times are GMT +1. The time now is 08:39 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"