run time error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I keep getting a "runtime error #91 Object Variable or With Block
Not Set" error message at the "fso.createtextfile" line of code below. Any
thoughts?

I'm using Access 2003.

Set txtout = fso.CreateTextFile(FullFilePath, True)
txtout.WriteLine s
txtout.Close


thanks.
 
Try:

Set fso = CreateObject("Scripting.FileSystemObject")
Set txtout = fso.CreateTextFile(FullFilePath, True)
txtout.WriteLine s
txtout.Close

Cheers.

BW
 
Actually, you are correct.

The rest of my code had me setting the fso to "nothing" and I needed to
re-set it.

Thanks for the tip...
 
Back
Top