Welcome to the fracta.net forum!

Share your coding ideas or ask questions.

Question Export Data Skill Interval from Excel VBA

More
11 years 2 months ago #212 by roller
That might be OK and could be still working. The script is meant to save to this location:

C:\Documents and Settings\VT0189\Desktop\Daily RTM Report\Extract Data\TechnicalRaw.xls

Check to see if the file is being saved as I duplicated what you gave me.

I actually modified another script but forgot to remove the part that paste - the other script pasted the results in the book where the code is.

Also did you change the user name and password to match yours? so if your user name is VT0189 then use Const Username As String = "VT0189", keep the " " around it and the password.

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

  • aamodahmad
  • Topic Author
  • Visitor
  • Visitor
11 years 2 months ago #213 by aamodahmad
Replied by aamodahmad on topic Export Data Skill Interval from Excel VBA
Dear Roller,

I had tried and guest what? it owesome. i had export the data from CMS. I will explore my self on the next step how to export multiple skill interval on 1 script like below:

'LANGUAGE=ENU
'SERVERNAME=10.21.150.96
Public Sub Main()

'## report date dd/mm/yyyy
xxdate = "17/02/2013"

'## Login ID Windows
vtid = "VT0189"

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: TM_Skill Interval: Export Data"
'## Parameters.Add "Report: Historical: Designer: TM_Skill Interval: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\TM_Skill Interval","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "390","_Top"
'## Parameters.Add "45","_Left"
'## Parameters.Add "19110","_Width"
'## Parameters.Add "14595","_Height"
'## Parameters.Add "The report Historical\Designer\TM_Skill Interval was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "151;201;203;289;290;287;288;265;266;263;264;1017;1201;1018;1202;271;272;269;270;1205;328;329","Splits/Skills"
'## Parameters.Add xxdate,"Date"
'## Parameters.Add "00:00-23:30","Times"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\TechnicalRaw.xls","_Output"
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "True","_Labels"
'## Parameters.Add "False","_DurSecs"

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.Window.Top = 390
Rep.Window.Left = 45
Rep.Window.Width = 19110
Rep.Window.Height = 14595



Rep.SetProperty "Splits/Skills","151;201;203;289;290;287;288;265;266;263;264;1017;1201;1018;1202;271;272;269;270;1205;328;329"

Rep.SetProperty "Date",xxdate

Rep.SetProperty "Times","00:00-23:30"




b = Rep.ExportData("C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\TechnicalRaw.xls", 9, 0, True, True, False)





Rep.Quit



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

End If
Set Info = Nothing
'## cvs_cmd_end

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: TM_Skill Interval: Export Data"
'## Parameters.Add "Report: Historical: Designer: TM_Skill Interval: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\TM_Skill Interval","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "390","_Top"
'## Parameters.Add "45","_Left"
'## Parameters.Add "19110","_Width"
'## Parameters.Add "14595","_Height"
'## Parameters.Add "The report Historical\Designer\TM_Skill Interval was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "263;264;269;270;287;288;328;201;203;1201;1202;1205","Splits/Skills"
'## Parameters.Add xxdate,"Date"
'## Parameters.Add "00:00-23:30","Times"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\HOMERaw.xls","_Output"
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "True","_Labels"
'## Parameters.Add "False","_DurSecs"

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.Window.Top = 390
Rep.Window.Left = 45
Rep.Window.Width = 19110
Rep.Window.Height = 14595



Rep.SetProperty "Splits/Skills","263;264;269;270;287;288;328;201;203;1201;1202;1205"

Rep.SetProperty "Date",xxdate

Rep.SetProperty "Times","00:00-23:30"




b = Rep.ExportData("C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\HOMERaw.xls", 9, 0, True, True, False)





Rep.Quit



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

End If
Set Info = Nothing
'## cvs_cmd_end

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: TM_Skill Interval: Export Data"
'## Parameters.Add "Report: Historical: Designer: TM_Skill Interval: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\TM_Skill Interval","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "390","_Top"
'## Parameters.Add "45","_Left"
'## Parameters.Add "19110","_Width"
'## Parameters.Add "14595","_Height"
'## Parameters.Add "The report Historical\Designer\TM_Skill Interval was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "271;272;265;266;289;290;329","Splits/Skills"
'## Parameters.Add xxdate,"Date"
'## Parameters.Add "08:00-22:00","Times"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\SMERaw.xls","_Output"
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "True","_Labels"
'## Parameters.Add "False","_DurSecs"

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.Window.Top = 390
Rep.Window.Left = 45
Rep.Window.Width = 19110
Rep.Window.Height = 14595



Rep.SetProperty "Splits/Skills","271;272;265;266;289;290;329"

Rep.SetProperty "Date",xxdate

Rep.SetProperty "Times","08:00-22:00"




b = Rep.ExportData("C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\SMERaw.xls", 9, 0, True, True, False)





Rep.Quit



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

End If
Set Info = Nothing
'## cvs_cmd_end


'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: TM_Skill Interval: Export Data"
'## Parameters.Add "Report: Historical: Designer: TM_Skill Interval: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\TM_Skill Interval","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "390","_Top"
'## Parameters.Add "45","_Left"
'## Parameters.Add "19110","_Width"
'## Parameters.Add "14595","_Height"
'## Parameters.Add "The report Historical\Designer\TM_Skill Interval was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "1205;328;329","Splits/Skills"
'## Parameters.Add xxdate,"Date"
'## Parameters.Add "09:00-22:00","Times"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\PT_VADSRaw.xls","_Output"
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "True","_Labels"
'## Parameters.Add "False","_DurSecs"

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.Window.Top = 390
Rep.Window.Left = 45
Rep.Window.Width = 19110
Rep.Window.Height = 14595



Rep.SetProperty "Splits/Skills","1205;328;329"

Rep.SetProperty "Date",xxdate

Rep.SetProperty "Times","09:00-22:00"




b = Rep.ExportData("C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\PT_VADSRaw.xls", 9, 0, True, True, False)





Rep.Quit



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

End If
Set Info = Nothing
'## cvs_cmd_end


'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: TM_Skill Interval: Export Data"
'## Parameters.Add "Report: Historical: Designer: TM_Skill Interval: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\TM_Skill Interval","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "390","_Top"
'## Parameters.Add "45","_Left"
'## Parameters.Add "19110","_Width"
'## Parameters.Add "14595","_Height"
'## Parameters.Add "The report Historical\Designer\TM_Skill Interval was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "318;317;307;319;309;1303;1304;1301;1302;1311;1312;1309;1310","Splits/Skills"
'## Parameters.Add xxdate,"Date"
'## Parameters.Add "00:00-23:30","Times"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\CardsRaw.xls","_Output"
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "True","_Labels"
'## Parameters.Add "False","_DurSecs"

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.Window.Top = 390
Rep.Window.Left = 45
Rep.Window.Width = 19110
Rep.Window.Height = 14595



Rep.SetProperty "Splits/Skills","318;317;307;319;309;1303;1304;1301;1302;1311;1312;1309;1310"

Rep.SetProperty "Date",xxdate

Rep.SetProperty "Times","00:00-23:30"




b = Rep.ExportData("C:\Documents and Settings\" & vtid & "\Desktop\Daily RTM Report\Extract Data\CardsRaw.xls", 9, 0, True, True, False)





Rep.Quit



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

End If
Set Info = Nothing
'## cvs_cmd_end

End Sub

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

More
11 years 2 months ago #214 by roller
Good stuff so it works.

I usally use arrays to store values and loops to run the same code for multiple reports - good luck.

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

  • aamodahmad
  • Topic Author
  • Visitor
  • Visitor
11 years 2 months ago #215 by aamodahmad
Replied by aamodahmad on topic Export Data Skill Interval from Excel VBA
Dear Roller,

At this part from script i want the script to capture username and password from Input Box

Const Username As String = "yourusename"
Const Password1 As String = "yourpassword"

Please share...

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

More
11 years 2 months ago #216 by roller
like this...

Const Username As String = InputBox("User name", "Please enter")

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

  • aamodahmad
  • Topic Author
  • Visitor
  • Visitor
11 years 2 months ago #217 by aamodahmad
Replied by aamodahmad on topic Export Data Skill Interval from Excel VBA
Dear Roller,

Thanks a lot for your assistance, below is the script that i modify from your script to export data as i attached before.

Sub Input_Data()
Const cmsid As String = "VT0189"
Const Pass As String = "aamod1123"

xxdate = InputBox("Date")

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, "", "", "10.21.150.96", False, "ENU", cvsSrv, cvsConn) Then

If cvsConn.Login(cmsid, Pass, "10.21.150.96", "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

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

Rep.SetProperty "Splits/Skills", "151;201;203;289;290;287;288;265;266;263;264;1017;1201;1018;1202;271;272;269;270;1205;328;329"
Rep.SetProperty "Date", xxdate
Rep.SetProperty "Times", "00:00-23:30"
Overall = Rep.ExportData("\\10.92.102.12\usb share management\OPS_SUPPORT_TMIS\RTFM\Script\Extract Data\TechnicalRaw.xls", 9, 0, True, True, False)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
Home = cvsSrv.Reports.CreateReport(Info, Rep)
If Home Then

Rep.SetProperty "Splits/Skills", "263;264;269;270;287;288;328;201;203;1201;1202;1205"
Rep.SetProperty "Date", xxdate
Rep.SetProperty "Times", "00:00-23:30"
Home = Rep.ExportData("\\10.92.102.12\usb share management\OPS_SUPPORT_TMIS\RTFM\Script\Extract Data\HomeRaw.xls", 9, 0, True, True, False)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If

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

Rep.SetProperty "Splits/Skills", "271;272;265;266;289;290;329"
Rep.SetProperty "Date", xxdate
Rep.SetProperty "Times", "08:00-22:00"
SME = Rep.ExportData("\\10.92.102.12\usb share management\OPS_SUPPORT_TMIS\RTFM\Script\Extract Data\SMERaw.xls", 9, 0, True, True, False)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If

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

Rep.SetProperty "Splits/Skills", "1205;328;329"
Rep.SetProperty "Date", xxdate
Rep.SetProperty "Times", "9:00-22:00"
PTVADS = Rep.ExportData("\\10.92.102.12\usb share management\OPS_SUPPORT_TMIS\RTFM\Script\Extract Data\PT_VADSRaw.xls", 9, 0, True, True, False)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If

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

Rep.SetProperty "Splits/Skills", "318;317;307;319;309;1303;1304;1301;1302;1311;1312;1309;1310"
Rep.SetProperty "Date", xxdate
Rep.SetProperty "Times", "00:00-23:30"
Cards = Rep.ExportData("\\10.92.102.12\usb share management\OPS_SUPPORT_TMIS\RTFM\Script\Extract Data\CardsRaw.xls", 9, 0, True, True, False)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If

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

End If

End If

cvsApp.Servers.Remove cvsSrv.ServerKey
cvsConn.Logout
cvsConn.Disconnect

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

End Sub

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

Time to create page: 1.286 seconds
Powered by Kunena Forum