Im trying to get the Text Statistics function from https://github.com/cgiffard/TextStatistics.js/blob/master/index.js Working in Excel I have minified the JavaScript code to shorten the concatenations Function Text_Statistics1(textString As String) Dim code As String code = "function text_stats(teststringtoprocess){(function(e){function t(e){var t=['li','p','h1','h2','h3','h4','h5','h6','dd'];t.forEach(function(t){e=e.replace('</'+t+'>','.')});e=e.replace(/<[^>]+>/g,'').replace(/[,:;()\-]/,' ').replace(/[\.!?]/,'.').replace(/^\s+/,'').replace(/[ ]*(\n|\r\n|\r)[ ]*/,' ').replace(/([\.])[\. ]+/,