+ Reply to Thread
Results 1 to 1 of 1

Using VBA in excel to export data from Avaya CMS

Hybrid View

  1. #1
    Registered User
    Join Date
    03-21-2008
    Posts
    52

    Using VBA in excel to export data from Avaya CMS

    Hi guys,

    I'm totally stumped on this one. I'm trying to run a report from Avaya CMS using excel. I've been told it can be done but I can't find much on it in the Avaya forums apart from some code which purports to do what I want. The code is as follows:

    Public Sub Single_CMS_Report_Extract()
    
    On Error Resume Next
    
    ' Add the files specified below to the References section:
    ' Tools -> References -> Browse to the CMS directory,
    ' e.g.: "C:\Program Files\Avaya\CMS Supervisor R14"
    Dim cmsApplication As ACSUP.cvsApplication 'acsApp.exe
    Dim cmsServer As ACSUPSRV.cvsServer 'acsSRV.exe
    Dim cmsConnection As ACSCN.cvsConnection 'cvsconn.dll
    Dim cmsCatalog As ACSCTLG.cvsCatalog 'cvsctlg.dll
    Dim cmsReport As ACSREP.cvsReport 'acsRep.exe
    
    Dim myLog As String, myPass As String, myServer As String
    Dim reportPath As String, reportName As String, reportPrompt(1 To 2, 1 To 2) As String
    Dim exportPath As String, exportName As String
    
    ' Assigns Variables
    myLog = "my CMS log in"
    myPass = "my CMS password"
    myServer = "server address"
    reportPath = "Historical\Designer\"
    reportName = "Agent Group Daily Summary Report"
    reportPrompt(1, 1) = "Agent Group"
    reportPrompt(1, 2) = "IPS Team View"
    reportPrompt(2, 1) = "Dates"
    reportPrompt(2, 2) = "-1"
    exportPath = "C:\Documents and Settings\My Documents"
    exportName = "Test.TXT"
    
    ' Open the CMS Application, launches acsApp.exe
    ' If a CMS Supervisor console is already open,
    ' the existing acsApp.exe is used.
    Set cmsApplication = CreateObject("ACSUP.cvsApplication")
    Set cmsServer = CreateObject("ACSUPSRV.cvsServer")
    Set cmsConnection = CreateObject("ACSCN.cvsConnection")
    cmsConnection.bAutoRetry = True
    
    ' Connects to the server, launches acsSRV.exe & ACSTrans.exe (2x)
    If cmsApplication.CreateServer(myLog, myPass, "", myServer, False, "ENU", cmsServer, cmsConnection) Then
    If cmsConnection.login(myLog, myPass, myServer, "ENU", "", False) Then
    End If
    End If
    
    ' Gets collection of Reports available on cmsServer
    Set cmsCatalog = cmsServer.Reports
    If cmsServer.Connected = False Then cmsServer.Reports.ACD = 1
    
    ' Sets parameters for report, launches ACSRep.exe (2x)
    cmsCatalog.CreateReport cmsCatalog.Reports.Item(reportPath & reportName), cmsReport
    If cmsReport.SetProperty(reportPrompt(1, 1), reportPrompt(2, 1)) And cmsReport.SetProperty(reportPrompt(1, 2), reportPrompt(2, 2)) Then
    End If
    
    ' Runs report and extracts results
    cmsReport.ExportData exportPath & exportName, 9, 0, False, False, True
    
    ' Kills active report & server
    If Not cmsServer.Interactive Then
    cmsServer.ActiveTasks.Remove cmsReport.TaskID
    cmsApplication.Servers.Remove cmsServer.ServerKey
    End If
    
    ' Logs out
    cmsReport.Quit
    cmsConnection.Logout
    cmsConnection.Disconnect
    cmsServer.Connected = False
    
    ' Releases objects
    Set cmsReport = Nothing
    Set cmsCatalog = Nothing
    Set cmsConnection = Nothing
    Set cmsServer = Nothing
    Set cmsApplication = Nothing
    
    End Sub
    I've changed the variables so you don't have my log in details!

    I keep on getting an error saying that excel is waiting for another application to perform an OLE action. Has anyone come across this before? Not sure whether this is a problem with the code, excel or CMS. If it's the latter then I apologise for posting to this forum.

    Thanks, Chris
    Last edited by monkdelafunk; 10-15-2008 at 06:07 AM. Reason: Misleading title

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Code to Export Excel Data to Text File
    By ashkash in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-13-2012, 05:59 AM
  2. Find, replace, add, delete data from UI?
    By saltaholicwm in forum Excel General
    Replies: 5
    Last Post: 10-11-2008, 03:47 AM
  3. Export Excel data to Word and PowerPoint
    By racudd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2007, 11:30 PM
  4. importing data:What i would like to do is be able to import
    By censura in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2007, 08:32 AM
  5. Macro to create new sheets from master data sheet
    By adsigel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2006, 09:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1