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