× Welcome to the fracta.net forum!

Share your coding ideas or ask questions.

Cannot Log In CMS after run script

More
5 years 8 months ago #500 by mozako
Hi Boller

I facing issue when i run script but not login CMS however after finish run script i cannot login cms
.I already tried clean up


Private Sub Main()

Const cmsid As String = ""
Const Pass As String = ""

Server = ""

TM100Assu = Worksheets("Summary").Range("D51").Value
TM100Prod = Worksheets("Summary").Range("D52").Value
TM100Bill = Worksheets("Summary").Range("D53").Value
TMUCAssu = Worksheets("Summary").Range("D54").Value
TMUCBill = Worksheets("Summary").Range("D55").Value
TMUCFull = Worksheets("Summary").Range("D56").Value
TMUCSales = Worksheets("Summary").Range("D57").Value
TMGO = Worksheets("Summary").Range("D58").Value
BillCCTX = Worksheets("Summary").Range("D59").Value
ProCCTX = Worksheets("Summary").Range("D60").Value

Filename = Worksheets("Summary").Range("C50").Value

TM100Assu1 = Worksheets("Summary").Range("E51").Value
TM100Prod2 = Worksheets("Summary").Range("E52").Value
TM100Bill3 = Worksheets("Summary").Range("E53").Value
TMUCAssu4 = Worksheets("Summary").Range("E54").Value
TMUCBill5 = Worksheets("Summary").Range("E55").Value
TMUCFull6 = Worksheets("Summary").Range("E56").Value
TMUCSales7 = Worksheets("Summary").Range("E57").Value
TMGO8 = Worksheets("Summary").Range("E58").Value
BillCCTX9 = Worksheets("Summary").Range("E59").Value
ProCCTX10 = Worksheets("Summary").Range("E60").Value

Date1 = Worksheets("Summary").Range("C2").Value


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

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

If cvsApp.CreateServer(cmsid, "", "", Server, False, "ENU", cvsSrv, cvsConn) Then

If cvsConn.Login(cmsid, Pass, Server, "ENU") Then

On Error Resume Next

cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Designer\TM_Skill Interval")

If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\TM_Skill Interval was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\TM_Skill Interval was not found on ACD 1."
Set Log = Nothing
End If
Else

b = cvsSrv.Reports.CreateReport(Info, Rep)
If b Then


Rep.SetProperty "Splits/Skills", TM100Assu
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", TM100Assu1
b = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("TM100-Assu").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit

c = cvsSrv.Reports.CreateReport(Info, Rep)
If c Then


Rep.SetProperty "Splits/Skills", TMUCAssu
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", TMUCAssu4
c = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("TMUC-Assu").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit


d = cvsSrv.Reports.CreateReport(Info, Rep)
If d Then

Rep.SetProperty "Splits/Skills", TMUCBill
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", TMUCBill5
d = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("TMUC-Bill").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit


e = cvsSrv.Reports.CreateReport(Info, Rep)
If e Then

Rep.SetProperty "Splits/Skills", TMUCFull
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", TMUCFull6
e = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("TMUC-Full").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit

f = cvsSrv.Reports.CreateReport(Info, Rep)
If f Then

Rep.SetProperty "Splits/Skills", TMUCSales
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", TMUCSales7
f = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("TMUC-Sales").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If

Set Info = Nothing

On Error Resume Next

cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Designer\TM_Skill Interval")

If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\TM_Skill Interval was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\TM_Skill Interval was not found on ACD 1."
Set Log = Nothing
End If
Else

b = cvsSrv.Reports.CreateReport(Info, Rep)
If b Then

Rep.SetProperty "Splits/Skills", TM100Prod
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", TM100Prod2
b = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("TM100-Prod").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit

c = cvsSrv.Reports.CreateReport(Info, Rep)
If c Then

Rep.SetProperty "Splits/Skills", TM100Bill
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", TM100Bill3
c = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("TM100-Bill").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit

d = cvsSrv.Reports.CreateReport(Info, Rep)
If d Then

Rep.SetProperty "Splits/Skills", TMGO
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", TMGO8
d = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("TMGO-R").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit

e = cvsSrv.Reports.CreateReport(Info, Rep)
If e Then

Rep.SetProperty "Splits/Skills", BillCCTX
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", BillCCTX9
e = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("Bill CCTX-R").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit

f = cvsSrv.Reports.CreateReport(Info, Rep)
If f Then

Rep.SetProperty "Splits/Skills", ProCCTX
Rep.SetProperty "Date", Date1
Rep.SetProperty "Times", ProCCTX10
f = Rep.ExportData("", 9, 0, True, True, True)
Windows(Filename).Activate
Sheets("Pro CCTX-R").Select
Cells.Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

Rep.Quit

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If

End If

End If

Set Info = Nothing
cvsApp.Servers.Remove cvsSrv.ServerKey
cvsConn.Logout
cvsConn.Disconnect


this is script i clean up
Set Log = Nothing
Set Rep = Nothing
Set cvsSrv = Nothing
Set cvsConn = Nothing
Set cvsApp = Nothing

Sheets("Summary").Select



End Sub
Attachments:

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

More
5 years 8 months ago - 5 years 8 months ago #501 by roller
Yes that will be the case, this is a well documented scenario in other posts on this site.

Either log in CMS application before you open Excel and run the VBA script or you have to close the Excel application completely to be able to log in CMS.

The reason for that from memory is that when you run the script in Excel it links to the error log and doesn't let go until you close Excel. So if Excel is open and VBA was running then you open the Avaya application it will just sit there as it tries to get this error log file access.

I haven't tried it but if you omit from the code anything to do with the below Object it might work. All you will lose is if an error takes places it will not have an entry in the error log files - which you probably never look at anyway.

Dim cvsLog As Object
Set Log = CreateObject("ACSERR.cvsLog").. and the other bits
Last edit: 5 years 8 months ago by roller.

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

More
5 years 8 months ago #502 by mozako
Thanks edgar

is works for me :)

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

Time to create page: 0.167 seconds
Powered by Kunena Forum