× Welcome to the fracta.net forum!

Share your coding ideas or ask questions.

Class not registered: CreateObject("ACSCN.cvsConnection")

More
5 months 2 weeks ago #736 by Dan
Hi,
I've been trying to solve this problem for a while now but not getting anywhere.
I currently have Windows 7 & Avaya CMS R17 and I'm running an excel file to connect to CMS and pull back multiple different reports, its all been working fine for years but now we're moving to CMS R19 and Windows 10 and problems have started.

There are no missing references, and I'm able to get the code to work if the CMS console is open and logged in, but that doesn't really help in my situation.

This is the line that's causing the error:
Set cmsConnection = CreateObject("ACSCN.cvsConnection")

Here is the full code:
Any help and pointers are appreciated .
Sub RefreshCMSData()

Dim bCMSExtractActive As Boolean
Dim sCMSReportPath As String
Dim sCMSReportName As String
Dim sCMSServer As String
Dim iCMSACD As Integer
Dim sCMSLogin As String
Dim sCMSPassword As String
Dim sCMSBackupServer As String
Dim iCMSBackupACD As Integer
Dim bCMSUseExistingCon As Boolean
Dim sCMSBackupLogin As String
Dim sCMSBackupPassword As String
Dim bCMSLogOutAfterExport As Boolean
Dim sCMSField1Heading As String
Dim sCMSField1Parameter As String
Dim sCMSField2Heading As String
Dim sCMSField2Parameter As String
Dim sCMSField3Heading As String
Dim sCMSField3Parameter As String
Dim sCMSExportPath As String
Dim sCMSExportName As String
Dim bCMSNullToZero As Boolean
Dim bCMSIncludeLabels As Boolean
Dim bCMSExportDurSecs As Boolean
Dim sCMSImportAddress As String

Dim sServer As String

'------------------------------------------------------------------------------------
' Clears vairables for next run
'------------------------------------------------------------------------------------

        sCMSReportPath = Empty
        sCMSReportName = Empty
        sCMSServer = Empty
        iCMSACD = Empty
        sCMSLogin = Empty
        sCMSPassword = Empty
        bCMSUseExistingCon = False
        sCMSBackupLogin = Empty
        sCMSBackupPassword = Empty
        bCMSLogOutAfterExport = False
        sCMSField1Heading = Empty
        sCMSField1Parameter = Empty
        sCMSField2Heading = Empty
        sCMSField2Parameter = Empty
        sCMSField3Heading = Empty
        sCMSField3Parameter = Empty
        sCMSExportPath = Empty
        sCMSExportName = Empty
        bCMSNullToZero = False
        bCMSIncludeLabels = False
        bCMSExportDurSecs = False
        sCMSImportAddress = Empty
        sServer = sCMSServer

'------------------------------------------------------------------------------------
' Assigns Vairables
'------------------------------------------------------------------------------------


        sCMSReportPath = "Historical\Designer\"
        sCMSReportName = "TestReportWin10"
        sCMSServer = " "
        iCMSACD = " "
        sCMSLogin = " "
        sCMSPassword = " "
        bCMSUseExistingCon = True
        sCMSBackupLogin = " "
        sCMSBackupPassword = " "
        bCMSLogOutAfterExport = False
        sCMSField1Heading = "Splits/Skills"
        sCMSField1Parameter = "5277"
        sCMSField2Heading = "Dates"
        sCMSField2Parameter = "08/01/2021"
        sCMSField3Heading = "Times"
        sCMSField3Parameter = "08:00-15:00"
        sCMSExportPath = " "
        sCMSExportName = "Test1.csv"
        bCMSNullToZero = False
        bCMSIncludeLabels = True
        bCMSExportDurSecs = True
        sCMSImportAddress = ""
        sServer = sCMSServer
        
Call ExportCMSReport(ReportPath:=sCMSReportPath, ReportName:=sCMSReportName, _
            myServer:=sServer, myACD:=iCMSACD, _
            myLogin:=sCMSLogin, myPassword:=sCMSPassword, _
            UseExistingConsole:=bCMSUseExistingCon, LogOutAfterExport:=bCMSLogOutAfterExport, _
            Field1Heading:=sCMSField1Heading, Field1Parameter:=sCMSField1Parameter, _
            Field2Heading:=sCMSField2Heading, Field2Parameter:=sCMSField2Parameter, _
            Field3Heading:=sCMSField3Heading, Field3Parameter:=sCMSField3Parameter, _
            ExportPath:=sCMSExportPath, ExportName:=sCMSExportName, _
            NullToZero:=bCMSNullToZero, IncludeLabels:=bCMSIncludeLabels, ExportDurSecs:=bCMSExportDurSecs)
            
            End Sub
            
    Sub ExportCMSReport(ReportPath As String, ReportName As String, _
    myServer As String, myACD As Integer, _
    myLogin As String, myPassword As String, _
    UseExistingConsole As Boolean, LogOutAfterExport As Boolean, _
    Field1Heading As String, Field1Parameter As String, _
    Field2Heading As String, Field2Parameter As String, _
    Optional Field3Heading As String, Optional Field3Parameter As String, _
    Optional Field4Heading As String, Optional Field4Parameter As String, _
    Optional ExportPath As String, Optional ExportName As String, _
    Optional NullToZero As Boolean, Optional IncludeLabels As Boolean, Optional ExportDurSecs As Boolean)
    
    
    Dim cmsReport As ACSREP.cvsReport 'acsRep.exe
    Dim iServer As Long
    
    Dim b1FieldComplete As Boolean
    Dim b2FieldComplete As Boolean
    Dim b3FieldComplete As Boolean
    Dim b4FieldComplete As Boolean
    Dim iNumFields As Integer

    'On Error Resume Next
    
    Application.StatusBar = False
    
    '--------------------------------------------------------------------------------------------------------
    ' Open the CMS Application, launches acsApp.exe
    '--------------------------------------------------------------------------------------------------------
    
    Application.StatusBar = "Extracting CMS report " & iReportCounter & ": Setting application..."

        Set cmsApplication = CreateObject("ACSUP.cvsApplication")

    '--------------------------------------------------------------------------------------------------------
    ' If a CMS Supervisor console is already open, the existing acsApp.exe is used.
    '--------------------------------------------------------------------------------------------------------
    
    blnMyServerFound = False
    Set cmsServer = Nothing
    If UseExistingConsole = True Then
        Application.StatusBar = "Extracting CMS report " & iReportCounter & ": Looking for server... """ & myServer & """"
        For iServer = 1 To cmsApplication.Servers.Count
            If cmsApplication.Servers(iServer).Name = myServer _
            And cmsApplication.Servers(iServer).Connection.User = myLogin Then
                blnMyServerFound = True
                Exit For
            End If
        Next iServer
        If blnMyServerFound = True Then
            Set cmsServer = cmsApplication.Servers(iServer) '''''' we set a reference to the server here
            Set cmsConnection = cmsServer.Connection
        End If
    End If
    
    '--------------------------------------------------------------------------------------------------------
    ' If not connected to a server, log in
    '--------------------------------------------------------------------------------------------------------

    If cmsServer Is Nothing Then
Login:
        Set cmsServer = Nothing

        Set cmsServer = CreateObject("ACSUPSRV.cvsServer")
        cmsServer.Interactive = False
        
Set cmsConnection = CreateObject("ACSCN.cvsConnection")

        If UseExistingConsole = True Then
End If
        
        
        If cmsApplication.CreateServer(myLogin, myPassword, "", myServer, False, "ENU", cmsServer, cmsConnection) Then
            'Stop
            If cmsConnection.Login(myLogin, myPassword, myServer, "ENU", "", False) Then
            End If
        End If
    End If
    'Stop
    

Please Log in or Create an account to join the conversation.

More
5 months 2 weeks ago #737 by roller
Hi Dan, I haven't used CMS a long while and don't have access to a running instance for Avayab but I'd try the following.

Try the SetObject method instead of GetObject up see if makes a difference.

You may have more one instance of the server object running, server 2, 3, 4 ... this happens if one hangs. Look at windows task manager to see if it's the case. You'll find multiple processes are running. A reboot will be the easiest way to get rid of the orphaned objects.

Try using early binding to narrow down the cause by adding references to the Avaya libraries to see if it works and if a recent update caused a change in the naming of the ACS objects. I have a feeling that's the issue from memory when I moved to R19, in the tool you be able to see the new name of the class. Like instead of ACSCN it will be ACUN or something like that.

Check of you are still using the 32 bits excel not the 64bits.

I've seen a techniques where using the full path to the exe/Dll as an argument instead of the class name in get or setObject might help if the class has become unregistered.

Thse are just few things to try. But i have a feeling the class been renamed between these versions of CMS. Look at some other threads on this forum and compare the code a as i think this was discussed before.

Please Log in or Create an account to join the conversation.

More
5 months 2 weeks ago #738 by Dan
Thanks for your reply roller.

The entire office is been migrated to 64bits excel, after reading one of your answers from another thread I realise that is my issue.

Wish me look in convincing my company I need a 32bits version of office/excel.

Hopefully Avaya will update their connection to 64bits at some point.

Please Log in or Create an account to join the conversation.

Time to create page: 0.115 seconds
Powered by Kunena Forum