Help With Code

dc88310

New Member
Joined
Nov 2, 2014
Messages
43
Hi...

I have this code i got offline... i cannot figure out why it won't work. I am currently using Excel 2013 with Avaya CMS Supervisor R17.

When the code is finished executing, the output into excel sheet is the path of the report instead of the data that i am querying from that system... it should be the report data that report generates.

Can anyone take a look at the code and see if anything stands out... i have been looking at it for 3 hours now. Thanks in advance for your help.

Code:
Dim d As String

Sub getACD()


Dim cvsApp As Object
Dim cvsConn As Object
Dim cvsSrv As Object
Dim Rep As Object
Dim Info As Object, b As Object
Dim dt As Date


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


serverAddress = ThisWorkbook.Sheets("Panel").Cells(1, 2)
UserName = ThisWorkbook.Sheets("Panel").Cells(2, 2)
Password = ThisWorkbook.Sheets("Panel").Cells(3, 2)






If cvsApp.CreateServer(UserName, "", "", serverAddress, False, "ENU", cvsSrv, cvsConn) Then
    If cvsConn.login(UserName, Password, serverAddress, "ENU") Then
        On Error Resume Next
        cvsSrv.Reports.acd = 6
        r = 7
        Do While ThisWorkbook.Sheets("Panel").Cells(r, 1) <> ""
            Set Info = cvsSrv.Reports.Reports(ThisWorkbook.Sheets("Panel").Cells(r, 1))
            If Info Is Nothing Then
                MsgBox "The automated report was not found on ACD 1."
            Else
                b = cvsSrv.Reports.CreateReport(Info, Rep)
                If b Then
                    If ThisWorkbook.Sheets("Panel").Cells(r, 2) <> "" Then Rep.SetProperty ThisWorkbook.Sheets("Panel").Cells(r, 2).Text, ThisWorkbook.Sheets("Panel").Cells(r, 3).Text
                    If ThisWorkbook.Sheets("Panel").Cells(r, 4) <> "" Then Rep.SetProperty ThisWorkbook.Sheets("Panel").Cells(r, 4).Text, ThisWorkbook.Sheets("Panel").Cells(r, 5).Text
                    If ThisWorkbook.Sheets("Panel").Cells(r, 6) <> "" Then Rep.SetProperty ThisWorkbook.Sheets("Panel").Cells(r, 6).Text, ThisWorkbook.Sheets("Panel").Cells(r, 7).Text
                    b = Rep.ExportData("", 9, 0, False, False, True)
                    lr = ThisWorkbook.Sheets(ThisWorkbook.Sheets("Panel").Cells(r, 8).Text).Range("a65536").End(xlUp).Row
                    ThisWorkbook.Sheets(ThisWorkbook.Sheets("Panel").Cells(r, 8).Text).Cells(lr + 1, 1).PasteSpecial
                    Rep.Quit
                End If
                If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
                Set Rep = Nothing
            End If
            r = r + 1
          Loop
        Set Info = Nothing
    End If
End If


Set cvsApp = Nothing
Set cvsConn = Nothing
Set cvsSrv = Nothing
Set Rep = Nothing




End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Update -- So after talking to a couple of people, we determined that the script is logging into the software... its generating the data... but its not copying the data ... the paste that is occurring is something that is already in the clipboard from a previous copy/paste. We just can't figure out why its behaving this way. All the references seem to be correct... but its probably something really small that none of us are catching.
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,017
Members
448,936
Latest member
almerpogi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top