After a whole weekend of headscratching finaly got the below to work in VBS.
Trouble is this overwrites the data already in column A as opposed to just adding to it. any body have any any anmmendments nessasry to make so this dosnt happen.
Paul
Dim i, objfso, objfile, strline, arrline, aFile
Const ForReading = 1
Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
oExcel.Workbooks.Open("D:\get-group\GroupMembers.csv")
Set oSheet = oExcel.ActiveWorkbook.Worksheets(1)
oExcel.DisplayAlerts = FALSE
'objExcel.Workbooks.Add
i = 1
set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("D:\get-group\New-Stu-Passwords.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
arrLine = Split(strLine, ",")
oExcel.Cells(i, 1).Value = arrLine(0)
i = i + 1
Loop
oExcel.ActiveWorkbook.Saveas ("D:\get-group\New-Stu-Passwords.csv")
objFile.Close
oExcel.Quit
Trouble is this overwrites the data already in column A as opposed to just adding to it. any body have any any anmmendments nessasry to make so this dosnt happen.
Paul
Dim i, objfso, objfile, strline, arrline, aFile
Const ForReading = 1
Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
oExcel.Workbooks.Open("D:\get-group\GroupMembers.csv")
Set oSheet = oExcel.ActiveWorkbook.Worksheets(1)
oExcel.DisplayAlerts = FALSE
'objExcel.Workbooks.Add
i = 1
set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("D:\get-group\New-Stu-Passwords.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
arrLine = Split(strLine, ",")
oExcel.Cells(i, 1).Value = arrLine(0)
i = i + 1
Loop
oExcel.ActiveWorkbook.Saveas ("D:\get-group\New-Stu-Passwords.csv")
objFile.Close
oExcel.Quit