Help regarding saving a file ....

Author Message
soorya

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 6/14/2011
  • Status: offline
Help regarding saving a file .... Wednesday, June 15, 2011 3:15 AM (permalink)
0
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
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9