Help me understand where I am going wrong.

Author Message
TWztegduy

  • Total Posts : 4
  • Scores: 0
  • Reward points : 0
  • Joined: 11/14/2011
  • Status: offline
Help me understand where I am going wrong. Thursday, November 17, 2011 9:12 AM (permalink)
0
I am trying to get the script to simply open read and close the multiple files I have in a folder. Next im going to edit each line of file in the looking for a specific word. But cant seem to get the basics down. I using visual basics 2010. with a book for visual basic 2008 book.
It tells me to add "Set" perameters to the ObjFSo and ObjFolder. But its does not have the option for that or it simply dissapears.
Here's what I have so Far:
 
 

Private Sub BTndelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTndelete.Click

Dim StrFile, StrDirectory
StrFile = "\*.xls"
StrDirectory = "C:\Test"

'Open the file for reading.
objFso = CreateObject("Scripting.FileSystemObject")
'get folder
ObjFolder = ObjFso.Getfolder(StrDirectory)
'Read the entire file into memory.
StrFile = objFile.ReadAll
'Close the file.
objFile.Close()


End Sub
 
 
If you can help me understand what Im doing wrong. That would be great
 
#1
    59cobalt

    • Total Posts : 972
    • Scores: 91
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: online
    Re:Help me understand where I am going wrong. Thursday, November 17, 2011 9:21 AM (permalink)
    0
    TWztegduy
    If you can help me understand what Im doing wrong. That would be great
    Well, one thing you're doing wrong is posting your question in a forum that's for posting tutorials.
     
    #2
      GeneralError

      • Total Posts : 2
      • Scores: 0
      • Reward points : 0
      • Joined: 11/27/2011
      • Status: offline
      Re:Help me understand where I am going wrong. Monday, November 28, 2011 5:51 PM (permalink)
      0
      I think you still missing on the first part, open the file for reading. You're missing objFso.openTextFile(StrFile,ForReading). You need to open the file for reading.
       
      Hope it helps.
       
      #3

        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