I am trying to use the below macro to copy HTML into IE10 and paste back into excel in a rich text format
The error message is 'Run-time error '438' Object doesn't support this property or method.
When I debug it appears to be something wrong with the copy line?
Sub Sample()
Dim Ie As Object
Set Ie = CreateObject("InternetExplorer.Application")
With Ie
.Visible = False
.Navigate "about:blank"
.document.body.InnerHTML = Sheets("Sheet1").Range("A2").Value
.document.body.createtextrange.execCommand "Copy"
ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("B2")
.Quit
End With
End Sub
Any help would be highly appreciated!
The error message is 'Run-time error '438' Object doesn't support this property or method.
When I debug it appears to be something wrong with the copy line?
Sub Sample()
Dim Ie As Object
Set Ie = CreateObject("InternetExplorer.Application")
With Ie
.Visible = False
.Navigate "about:blank"
.document.body.InnerHTML = Sheets("Sheet1").Range("A2").Value
.document.body.createtextrange.execCommand "Copy"
ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("B2")
.Quit
End With
End Sub
Any help would be highly appreciated!