Avaya到VBA - 时区

时间:2016-12-13 16:35:46

标签: excel vba avaya

现在我正在开发一个新项目,我必须自动化仪表板。 此仪表板从avaya脚本获取信息。

我在过去两周内搜索了VBA中的一个脚本,该脚本实际上从avaya报告中获取信息并将其导入特定表格中的excel文件。

好吧,我的问题是我必须导出1个包含6个不同时区的报告。

例如: 历史\设计师\多日期多分裂技能间隔 - 欧洲/布鲁塞尔时区 历史\设计师\多日期多分裂技能间隔 - 美国/东部 等

下面是我的VBA代码,它适用于我的cms,但它没有考虑我的时区设置为欧洲/布鲁塞尔,并且它以默认时区导出。

请帮助我,这样我可以每周花几个小时放松工作:)

谢谢你们

    Sub EMEA()


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
Dim CMSRunning As String
Dim objWMIcimv2 As Object
Dim objProcess As Object
Dim objList As Object


CMSRunning = "acsSRV.exe"


Set objWMIcimv2 = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\.\root\cimv2") 'Connect to CIMV2 Namespace


Set objList = objWMIcimv2.ExecQuery _
("select * from win32_process where name='" & CMSRunning & "'") 'determine if CMS is running


If objList.Count = 0 Then 'If 0 then process isn't running


End If


Set cvsApp = CreateObject("ACSUP.cvsApplication")
Set cvsConn = CreateObject("ACSCN.cvsConnection")
Set cvsSrv = CreateObject("ACSUPSRV.cvsServer")
Set Rep = CreateObject("ACSREP.cvsReport")




Application.ScreenUpdating = 0


Set cvsSrv = cvsApp.Servers(1)
Application.ScreenUpdating = 1


AgGrp = InputBox("Enter Agent Group Name", "Agent Group", "952;953;271;270;221;222;223;224;231;233;232;234;235;246;241;243;242;247;249;245;244;248;255;258;256;259;257;261;262;260") 'change as needed for variables to enter into report
RpDate = InputBox("Enter Date", "Date", "-1") 'change as needed for variables to enter into report




'Start code from CMS Export script
On Error Resume Next


cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Designer\Multi Date Multi Split Skill interval")


b = cvsSrv.Reports.CreateReport(Info, Rep)
If b Then


Rep.Window.Top = 1830
Rep.Window.Left = 975
Rep.Window.Width = 17610
Rep.Window.Height = 11910


Rep.SetProperty "Splits/Skills", AgGrp 'change as needed for report variables


Rep.SetProperty "Dates", RpDate 'change as needed for report variables
Rep.SetProperty "Times", "00:00-23:30"
Rep.TimeZone = "Europe/Brussels"
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


Set Info = Nothing


' End code from CMS Export Script




cvsConn.logout
cvsConn.Disconnect
cvsSrv.Connected = False
Set Log = Nothing
Set Rep = Nothing
Set cvsSrv = Nothing
Set cvsConn = Nothing
Set cvsApp = Nothing
Set Info = Nothing




    Range("A1").Select
    ActiveSheet.Paste

    End Sub

0 个答案:

没有答案