1

I am getting the following error while running below macro. I have copy this macro from this side only. I am using below macro to copy dump in excel from Avaya CMS.

enter image description here

Code is as below. I am getting error on step:

Set cvsApp = CreateObject("ACSUP.cvsApplication")

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
On Error Resume Next
Set cvsApp = CreateObject("ACSUP.cvsApplication")
Set cvsConn = CreateObject("ACSCN.cvsConnection")
Set cvsSrv = CreateObject("ACSUPSRV.cvsserver")
Set Rep = CreateObject("ACSREP.cvsReport")
'Clear Data
Sheets("Sheet1").Select
Range("A1:AR300").ClearContents
Sheets("Domestic").Activate
serverAddress = "*****"
UserName = "*****"
Password1 = "*****"
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\SLA for skill(s) Daily Summary")
   If Info Is Nothing Then
      If cvsSrv.Interactive Then
          MsgBox "The report Historical\Designer\SLA for skill(s) Daily Summary", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
      Else
          Set Log = CreateObject("ACSERR.cvsLog")
          Log.AutoLogWrite "The report Historical\Designer\SLA for skill(s) Daily Summary"
          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", "CA10 CRU Parts;CA10 CRU Tech;CA14 ICG;CA10 LCSC;CA10 USEO P_1;CA14 ICG Overflow"
         Rep.SetProperty "Dates", "8/1/2020"
          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("Sheet1").Select
Range("A1").Select
ActiveSheet.Paste
End If
Sheets("Sheet1").Activate
End Sub

enter image description here

Chandan
  • 13
  • 4

1 Answers1

0

enter image description hereCan you give us a screen shot of your VBA References? (if there are MISSING:Libs, that are checked, they should be un-checked) Can you also look in the object browser in Excel to see if that object is actually available?

You shouldn't have to use CreateObject() late binding if the object/lib is referenced. Tools -> References in VBA editor.

Chandan
  • 13
  • 4
Peyter
  • 474
  • 3
  • 14
  • In references I have checked below options 1. Visual basics for application. 2. Microsoft Excel 15.0 Library, 3. OLE Automation 4.Microsoft office object library. – Chandan Jan 10 '20 at 13:36
  • Thank you for your response. Please confirm by what name i need check in object browser. How can I identify whether it is Possible or not. – Chandan Jan 10 '20 at 13:49
  • If you look here, the OP is trying to add references programatically. You can use his directory paths as an example to find the actual .dll and .exe files. If you go to Tools -> References-> Browse, you should be able to select these files and add them as reference to try the early binding. If late binding and early binding are not working, try simplifying the program to just creating the objects and add the variables as watches with line breaks. https://stackoverflow.com/questions/47169080/add-vba-references-programmatically – Peyter Jan 10 '20 at 14:36
  • ..If you expand the watched variables in the Watch window, you can see if your syntax is actually hooking onto an instance of the object. – Peyter Jan 10 '20 at 14:40
  • Hi Peyter, While browsing the references I am getting too many option. Could you please suggest which one need to select. – Chandan Jan 10 '20 at 15:20
  • If you look at the directories, they should have names that correspond to the object's you were adding via late binding. try these ones first: ascApp.exe cvsCONN.dll ascSRV.exe ascRep.exe cvsctlg.dll Then go to View -> Object Browser and see if you can locate the specific properties and methods in the hierarchy. – Peyter Jan 10 '20 at 15:32
  • Once the reference is added, you can try making the object in code and seeing if intellisense picks up the .properties .methods by typing it in the VBA editor. You may need to hit 'save' after the references are added. – Peyter Jan 10 '20 at 15:36
  • were you able to figure this out? if so. please mark the answer accepted or give more information. – Peyter Jan 13 '20 at 17:16