Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default loop through code and refernce text file for info

Hello-

I have some scipts in our call management system that export excel
files for each of our representatives, 80 in all. Each time we add or
remove a rep from our team, we need to edit the scripts accordingly.
The code shown below runs for the first rep, then repeats again and
again until all reps have an excel report generated. I want to
simplify this by having a seperate text file that holds the employee
numbers, so that the code will just loop through each rep and pull
their ID # from the text file until all reps have been processed. I
hope this makes sense, any help is greatly appreciated.

There are 4 locations in the code below that I want to pull the number
"72610" from a text file, then repeat the same process for all other
reps.

Scott

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: CS Agent Summary by
Day adj: Export Data"
'## Parameters.Add "Report: Historical: Designer: CS Agent Summary by
Day adj: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\CS Agent Summary by Day
adj","_Report"
'## Parameters.Add "2","_ACD"
'## Parameters.Add "30","_Top"
'## Parameters.Add "60","_Left"
'## Parameters.Add "15285","_Width"
'## Parameters.Add "11010","_Height"
'## Parameters.Add "The report Historical\Designer\CS Agent Summary
by Day adj was not found on ACD 2.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "72610","Agent" <------ 72610 is the Agent # that I
want pulled from a text list
'## Parameters.Add "-1","Dates"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "M:\CentreVuReports\Agent Daily Reports\Reno Reps
\72610.xls","_Output" <--And here
'## 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 = 2
Set Info = cvsSrv.Reports.Reports("Historical\Designer\CS Agent
Summary by Day adj")

If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\CS Agent Summary by Day
adj was not found on ACD 2.", vbCritical Or vbOKOnly, "Avaya CMS
Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\CS Agent Summary
by Day adj was not found on ACD 2."
Set Log = Nothing
End If
Else

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

Rep.Window.Top = 30
Rep.Window.Left = 60
Rep.Window.Width = 15285
Rep.Window.Height = 11010



Rep.SetProperty "Agent","72610" <--- And Here

Rep.SetProperty "Dates","-1"




b = Rep.ExportData("M:\CentreVuReports\Agent Daily Reports\Reno
Reps\72610.xls", 9, 0, True, True, False) < ----And here





Rep.Quit



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

End If
Set Info = Nothing
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default loop through code and refernce text file for info

What you'll get here is a VBA solution. What you need is to post to a
group that supports your script language. I doubt if VBA's syntax to
read/write a text file is compatible with your script language. Look
for a news group that begins with "microsoft.public.scripting."
followed by your scripting language.

Basically, all you need to do is load the text file contents into an
array an loop the array to process for each agent.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refernce other files and auto update info Riptide Excel Discussion (Misc queries) 1 January 13th 10 09:23 PM
Code to create dbase file from text file? Hilton Excel Discussion (Misc queries) 0 October 9th 08 10:37 AM
Loop for VBA code? paulinoluciano Excel Worksheet Functions 5 December 28th 05 01:30 PM
How to Loop some code Phil Osman Excel Discussion (Misc queries) 2 August 19th 05 11:14 AM
VB for excel, how do I loop through code steve hobden via OfficeKB.com Excel Discussion (Misc queries) 2 June 9th 05 01:59 PM


All times are GMT +1. The time now is 09:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"