【发布时间】:2018-06-16 01:35:18
【问题描述】:
我有一个从 Avaya CMS 中提取数据的 excel 报告,但是他们将 Avaya CMS 应用程序从我的工作站移到了 RD Web Access。现在 VBA 不再工作了,因为安装在我的工作站上的旧 CMS 现在处于 RD Web 访问中。是否可以通过 RD Web 访问访问 Avaya CMS 以通过 VBA 提取报告以生成 excel?
提前致谢!!
Sub GetIntervalData()
Dim cvsApp As Object
Dim cvsConn As Object
Dim cvsSrv As Object
Dim Rep As Object
Dim Info As Object, Log As Object, b As Object
Set cvsApp = CreateObject("ACSUP.cvsApplication")
'Set cvsConn = CreateObject("ACSCN.cvsConnection")
Set cvsSrv = CreateObject("ACSUPSRV.cvsserver")
Set Rep = CreateObject("ACSREP.cvsReport")
'Clear Data
Sheets("Domestic Interval Data").Select
Range("A1:AR300").ClearContents
Sheets("Domestic").Activate
serverAddress = Range("B1").Value
UserName = Range("B2").Value
Password1 = Range("C2").Value
If cvsApp.CreateServer(UserName, "", "", serverAddress, False, "ENU", cvsSrv, cvsConn) Then
If cvsConn.Login(UserName, Password1, serverAddress, "ENU") Then
On Error Resume Next
cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Designer\APS Report (MultiSkill)")
If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\APS Report (MultiSkill) was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\APS Report (MultiSkill) was not found on ACD 1."
Set Log = Nothing
End If
Else
b = cvsSrv.Reports.CreateReport(Info, Rep)
If b Then
Rep.Window.Top = 75
Rep.Window.Left = 690
Rep.Window.Width = 19140
Rep.Window.Height = 11400
Rep.TimeZone = "default"
Rep.SetProperty "Split/Skills","1555;1551;1552;1553;1554;1570;1998;1999"
Rep.SetProperty "Dates", "2/14/2018"
Rep.SetProperty "Times", "00:00-23:30"
b = Rep.ExportData("", 9, 0, False, False, True)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
End If
Set Info = Nothing
End If
cvsApp.Servers.Remove cvsSrv.ServerKey
cvsConn.Logout
cvsConn.Disconnect
cvsSrv.Connected = False
Set Log = Nothing
Set Rep = Nothing
Set cvsSrv = Nothing
Set cvsConn = Nothing
Set cvsApp = Nothing
Sheets("Domestic Interval Data").Select
Range("A1").Select
ActiveSheet.Paste
End If
Sheets("Domestic").Activate
End Sub
**此代码创建 avaya cms 会话并运行报告,将其提取并直接粘贴到 excel 中
【问题讨论】:
-
有后台可以访问和查询吗?顺便说一句,您的问题无法回答。
-
我可以通过 RD Web 访问访问 Avaya CMS 并运行报告,但现在我必须手动获取数据,然后将其放在我的 Excel 报告中,然后再将 CMS 移至 RD Web 访问我可以通过 excel vba 自动提取 CMS 报告,现在它不再工作了。
-
您正在寻找如何设置 RD Web 访问的文件路径?
-
如果您想设置文件路径= \\remotehost\path\to\somefolder\somefile.txt,请尝试这样
-
有助于解释您所说的“RD Web 访问”是什么意思