VBA .document.body.createtextrange.execCommand" Copy"运行时错误

时间:2017-08-09 18:18:01

标签: excel vba excel-vba

当我使用下面的代码在单元格中呈现HTML时,我会在行上收到"Run-time error '438': Object doesn't support this property or method" .document.body.createtextrange.execCommand "Copy".

有没有人知道修复或解决方法?

Sub FormatHtmlViaIE()
Dim ie As Object, tr, c As Range

Set ie = CreateObject("internetexplorer.application")
Set tr = Range("B2:F500")
With ie
    .Visible = False
    .Navigate "about:blank"
    Do While .busy
    Loop

    For Each c In tr
        .document.body.innerHTML = c.Value
        .document.body.createtextrange.execCommand "Copy"
        Selection.Parent.Paste Destination:=c
    Next c
    .Quit
End With
End Sub

0 个答案:

没有答案