为什么微软的Excel 2013的ActiveX组件不能创build对象?

我在2013 Excel中运行一些Visual Basic代码时遇到问题。 我有一个函数,我和我在一个excel列中调用它。 这是我的function如下:

Public Function GetDetailedDescriptionAsHtml(json As String) On Error GoTo ErrHandler If json = "" Then json = "[]" End If Set sc = CreateObject("scriptcontrol") sc.Language = "JScript" Dim html As String sc.Eval "var obj=(" & json & ")" 'evaluate the json response sc.AddCode "function GetDetailedDescriptionHtml(){ var htm =''; for(var i = 0; i< obj.length; i++){ htm += '<h2>' + obj[i].Header + '</h2><p>' + obj[i].Description +'</p>' } return htm;}" html = sc.Run("GetDetailedDescriptionHtml") GetDetailedDescriptionAsHtml = html ErrHandler: MsgBox "Something's wrong: " & vbCrLf & Err.Description End Function 

错误消息是说:'microsoft excel 2013 activex组件不能创build对象'在这行代码Set sc = CreateObject(“scriptcontrol”)'。

奇怪的是这个function正在除了我之外的同事。

为什么会这样呢? 是否有一些特定的图书馆需要引用? 我已经在网上search,但直到现在我还无法解决这个问题。

希望您能够帮助我。

谢谢。