Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Strange behaviour

If I run the following the the string appears in the cell WITH all the
tags

ThisWorkbook.Sheets("Sheet1").Cells(10, 4) = "<html<table
border=""1""<thhelloworld</th</table</html"

but if I copy that string from another application into a cell in
Excel then the result is 'helloworld' in a box i.e the tags have
become active

How can I change the code so the tags are active?

Any help appreciated
Jason.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Strange behaviour

On Feb 22, 5:03*am, WhytheQ wrote:
If I run the following the the string appears in the cell WITH all the
tags

ThisWorkbook.Sheets("Sheet1").Cells(10, 4) = "<html<table
border=""1""<thhelloworld</th</table</html"

but if I copy that string from another application into a cell in
Excel then the result is 'helloworld' in a box i.e the tags have
become active

How can I change the code so the tags are active?

Any help appreciated
Jason.


If you add a reference to the Microsoft Forms2.0 Object Library (via
tools/references) the following seems to work:

Sub test()

Dim DataObj As New DataObject
Dim HTML As String
Dim myRange As Range

HTML = "<html<table border=""1""<thhelloworld</th</table</html"

Set myRange = ThisWorkbook.Sheets("Sheet1").Cells(10, 4)

DataObj.SetText (HTML)
DataObj.PutInClipboard

myRange.PasteSpecial
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Strange behaviour

On Feb 22, 11:49*am, John Coleman wrote:
On Feb 22, 5:03*am, WhytheQ wrote:

If I run the following the the string appears in the cell WITH all the
tags


ThisWorkbook.Sheets("Sheet1").Cells(10, 4) = "<html<table
border=""1""<thhelloworld</th</table</html"


but if I copy that string from another application into a cell in
Excel then the result is 'helloworld' in a box i.e the tags have
become active


How can I change the code so the tags are active?


Any help appreciated
Jason.


If you add a reference to the Microsoft Forms2.0 Object Library (via
tools/references) the following seems to work:

Sub test()

Dim DataObj As New DataObject
Dim HTML As String
Dim myRange As Range

HTML = "<html<table border=""1""<thhelloworld</th</table</html"

Set myRange = ThisWorkbook.Sheets("Sheet1").Cells(10, 4)

DataObj.SetText (HTML)
DataObj.PutInClipboard

myRange.PasteSpecial
End Sub


Cheers John - much appreciated

J
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
strange behaviour sunilpatel Excel Programming 1 May 15th 09 12:22 AM
strange behaviour Risky Dave Excel Programming 1 November 26th 08 01:57 AM
Strange if(***) behaviour? Excel 2003 - SPB Excel Discussion (Misc queries) 6 August 6th 06 05:34 PM
Strange behaviour in VBA Help Michael Singmin Excel Programming 4 June 4th 04 07:06 PM
strange behaviour Patrick Molloy Excel Programming 0 September 4th 03 07:51 AM


All times are GMT +1. The time now is 08:35 AM.

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

About Us

"It's about Microsoft Excel"