为什么在尝试自动执行Avaya CMS时使用excel 2016会出现错误?

时间:2019-03-12 01:20:49

标签: excel vba runtime-error avaya

我粘贴了以下代码,以从Avaya CMS中提取信息并将其直接粘贴到此工作表中,效果很好,直到我们从excel 2010切换到Excel 2016,现在它给了我这个错误:

“运行时错误'-2147319783(80028019)”:

自动化错误 旧格式或无效类型库”

我不知道如何解决此问题,如果有人可以给我建议,将不胜感激。

Dim cvsApp As New ACSUP.cvsApplication
Dim cvsSrv As New ACSUPSRV.cvsServer
Dim Rep As New ACSREP.cvsReport
Dim Info As Object, Log As Object, b As Object
Dim logged As Boolean
Dim timevar As String

Public Sub CMS_REL()
Application.ScreenUpdating = 0
sk = "66"

Sheets("Per Teams").Activate
timevar = Range("F20")

Set cvsSrv = cvsApp.Servers(1)
Call doRep("Historical\Designer\Agent ACD Release (MultiSkill)", sk)


    Sheets("Released").Select
        Range("A:H").Select
            Selection.ClearContents
        Range("A1").Select
            ActiveSheet.Paste
        Range("A1").Select
    Sheets("Per Teams").Select



logout
Application.ScreenUpdating = 1


End Sub


Sub doRep(sReportName As String, ByVal sk As Integer)

On Error Resume Next
cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports(sReportName)
If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The Report " & sReportName & " was not found on ACD 1", vbCritical Or vbOKOnly, "CentreVu Supervisor"
Else
Set Log = CreateObject("ACSERR.cvslog")
Log.AutoLogWrite "The Report " & sReportName & " was not found on ACD 1"
Set Log = Nothing
End If
Else
b = cvsSrv.Reports.CreateReport(Info, Rep)
If b Then
Debug.Print Rep.SetProperty("Splits/Skills", "64-72")
Debug.Print Rep.SetProperty("Dates", 0)
Debug.Print Rep.SetProperty("Times", "00:00-" & timevar)
b = Rep.ExportData("", 9, 0, True, True, True)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
End If

Set Info = Nothing



End Sub

Sub logout()
Set Log = Nothing
Set Rep = Nothing
Set cvsSrv = Nothing
Set cvsApp = Nothing

End Sub

1 个答案:

答案 0 :(得分:0)

更改此行

Dim cvsApp As New ACSUP.cvsApplication

对此

  Dim cvsApp As Object
  Set cvsApp = CreateObject("ACSUP.cvsApplication")