run time error

C

Craig

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.
 
B

BeWyched

Try:

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

Cheers.

BW
 
C

Craig

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top