Welcome to the fracta.net forum!

Share your coding ideas or ask questions.

Question CMS paste error

More
5 years 4 months ago #683 by cybergremlin
CMS paste error was created by cybergremlin
Hi

I have the below code working fine till we upgraded to windoes 10, when it pastes the data into the sheet it moves the data over to the right for the first 43 lines then it "corrects" itself.
here is my code:

Dim cvsApp As New ACSUP.cvsApplication
'Dim cvsConn As New ACSCN.cvsConnection
Dim cvsSrv As New ACSUPSRV.cvsServer
Dim Rep As New ACSREP.cvsReport
Dim Info As Object, Log As Object, b As Object
Dim logged As Boolean


Public Sub CMSConn()
Application.ScreenUpdating = 0
sk = Worksheets("Interval").Range("A2")
mydate = Worksheets("Interval").Range("C5")
ThisWorkbook.Sheets(1).Cells.ClearContents

Set cvsSrv = cvsApp.Servers(1)
Call doRep("Historical\Designer\Interval Report JM", sk)

ThisWorkbook.Sheets(1).Cells(1, 1).PasteSpecial
logout
Application.ScreenUpdating = 1
If Err.Number <> 91 Then
MsgBox "Make sure you are logged in CMS, if already logged in close CMS and Excel program and re-login."
End If

End Sub


Sub doRep(sReportName As String, ByVal sk As Variant)

On Error Resume Next
cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports(sReportName)
If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The Report " & sReportName & " was not found on ACD 1", vbCritical Or vbOKOnly, "CentreVu Supervisor"
Else
Set Log = CreateObject("ACSERR.cvslog")
Log.AutoLogWrite "The Report " & sReportName & " was not found on ACD 1"
Set Log = Nothing
End If
Else
b = cvsSrv.Reports.CreateReport(Info, Rep)
If b Then

Debug.Print Rep.SetProperty("Splits/Skills", sk)
Debug.Print Rep.SetProperty("Dates", Range("C5"))
Debug.Print Rep.SetProperty("Times", "08:00-23:59")
b = Rep.ExportData("", 9, 0, False, True, True)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
End If

Set Info = Nothing



End Sub

Sub logout()

Set Log = Nothing
Set Rep = Nothing
Set cvsSrv = Nothing
Set cvsApp = Nothing

End Sub

Can anyone help with this?
Attachments:

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

More
5 years 4 months ago #684 by roller
Replied by roller on topic CMS paste error
I can't see what is near cells A1 from your image so I have no idea wht is happening there but the fact that you interval starts at 8:00 might be related. Try with times 00:00-23:45 to see what happens!

On a separate observation of your script why not use Debug.Print Rep.SetProperty("Dates", myDate) since you declared that variable?
The following user(s) said Thank You: cybergremlin

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

More
5 years 4 months ago #686 by cybergremlin
Replied by cybergremlin on topic CMS paste error
The sheet is balnk prior to pasting the avaya data onto it so cell A1 contains the date from the report.
Chagin the times doesnt make a difference either it always seems to push the data out on line 44.

I managed to get it working by changing b = Rep.ExportData("", 9, 0, False, True, True) to False, False, True) and also changed the date property.

On a side not i have downloade your document Roller to run multiple sheets at once but what would i need to change to connect directly to CMS instead of having the server,usernam & password as part of the VBA?

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

More
5 years 4 months ago #688 by roller
Replied by roller on topic CMS paste error
The only way to connect directly without using the username and password in VBA is you must be logged in to the Avaya application yourself on the same PC and you hook into the running server object by using set yourServObject = cvsApp.Servers(1).

There is an example here that was posted by Holly just two days ago on how to connect directly.

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

Time to create page: 0.488 seconds
Powered by Kunena Forum