it is ok, i am glad that you answered :) i am newbie with vba
may i ask you how to change this line
Dim objData As DataObject ' Set a reference to MS Forms 2.0 ?
thank you so much guys
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I have a row with cells containing text strings with HTML code inside. I would like to see just HTML preview (no code) within cells. I would like to still have HTML code inside the cell, but it apears as text without <> etc...
Is that possible?
I tried
Sub Sample2()
Dim Ie As Object
Set Ie = CreateObject("InternetExplorer.Application")
With Ie
.Visible = False
.Navigate "about:blank"
.document.body.InnerHTML = Sheets("Sheet1").Range("A1").Value
.document.body.createtextrange.execCommand "Copy"
ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("A1")
.Quit
End With
End Sub
I get stuck with this line .document.body.createtextrange.execCommand "Copy"
could someone help me?
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
it is ok, i am glad that you answered :) i am newbie with vba
may i ask you how to change this line
Dim objData As DataObject ' Set a reference to MS Forms 2.0 ?
thank you so much guys
may i ask you how to change this line
Dim objData As DataObject ' Set a reference to MS Forms 2.0 ?
You can't, you must set the reference.
BTW, this reference is set automatically when you add an ActiveX control anywhere in your file. Means you can add a commandbitton to your file and remove it to set the reference.
Or set the reference manually in the VBA editor under Tools\References or execute the sub below.
Andreas.
Sub SetRef()
On Error Resume Next
'Microsoft Forms 2.0 Object Library
Application.VBE.ActiveVBProject.References.AddFromGuid _
"{0D452EE1-E08F-101A-852E-02608C4D0BB4}", 2, 0
End Sub