Hello .. i'am a nebiee in VBS scripting......
i want to extract data from excel1.xls , perform string manipulation on excel1.xls and store the data in excel2.xls. I am able to do the manipulation and the extracted data is visible on book1.xls , and throws up an error for object1.SaveAs "C:\Documents and Settings\AANADKAM\Desktop\task1\excel2.xls". Could anyone please let me know what is wrong... plz find my code snippet below:
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
("C:\Documents and Settings\AANADKAM\Desktop\task1\excel1.xls")
Set objExcel1 = CreateObject("Excel.Application")
objExcel1.Visible = True
objExcel1.Workbooks.Add
Set re = new regexp
'Dim names()
intRow = 1
intRow1 = 1
Do Until objExcel.Cells(intRow,1).Value = ""
re.Pattern = ".*soorya.*"
re.IgnoreCase = true
If (re.Test(objExcel.Cells(intRow,1).Value)) Then
objExcel1.Cells(intRow1,1).Value = objExcel.Cells(intRow,1).Value
'ReDim Preserve names(intRow1) = objExcel.Cells(intRow,1).Value
intRow1 = intRow1 + 1
END IF
intRow = intRow + 1
Loop
objExcel.Quit
objExcel1.workbooks(1).Save
objExcel1.workbooks(1).Close
objExcel1.SaveAs "C:\Documents and Settings\AANADKAM\Desktop\task1\excel2.xls"
objExcel1.Quit