'How do I write this Excel macro using AppleScript?

What I'm using: Most current version of Excel (365) on Mac.

My objective: I have a spreadsheet that contains around 10,000 cells containing text and HTML tags, I need to convert each cell to the rich text version, rather than the HTML written.

Issue: I was using this macro on my Windows laptop (also most current Excel), and it was working semi-properly, but that laptop is older/not running well and really slowed down, so now I am back to my new Mac. What needs to change in this code for it to do what I need in the Apple environment?

    Sub ConvertHTMLtoExcelText()
'Selected cells convert HTML code to formatted text
Dim cell As Range

With CreateObject("InternetExplorer.Application")
    .Visible = False
    .Navigate "about:blank"
    For Each cell In Selection
        If InStr(cell.Value, "<") > 0 Then
            .document.body.InnerHTML = cell.Value
            .ExecWB 17, 0
            .ExecWB 12, 2
            ActiveSheet.Paste Destination:=cell
        End If
    Next cell
    .Quit
End With
End Sub

What I need it to do: Open any individual cell containing html (identified by "<") as an HTML document in Safari's about:blank page, copy the text, paste it back into the cell. Bonus points for pasting line breaks within the same cell, but not absolutely necessary (I am excluding those and doing them manually as of now).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source