HELP on this strange errror : Method OpenTextFile of IFilesystem3 Failed

L

Learner

I have a VBA macro on MS Excel that should open and read from a Text
file. This is the code

Dim fs, Tempfile
Set fs = CreateObject("Scripting.FileSystemObject")
Set TempFile = fs.OpenTextFile(strInputFile, 1, False)
Do While TempFile.AtEndOfLine <> True
' Process
Loop

It works for all of our users but one. One guy is getting this strange
error meesage when the code executes. I checked his MS excel and found
its same as mine, Office 2003 SP1 (The code works fine in my machine).

Can you GURUS please help me on this.....
 
G

Guest

Can this user open the file. Find the file in windows explorer and try to
open it. They may not have access to open this file. If they can open it then
do they have the same drive mapping to get to the file. For example your G:
drive might be their H: drive. If this is the case you will have to use the
full path, not just the local mapping. For example \\MyServer\MyDirectory...

HTH
 
L

Learner

Thanks Jim!
I dont think this is the issue because the user has access to the txt
file the code is trying to open. Also, as you suggested its already in
\\Shareserver\Sharefolder\Sharefile.txt format
 

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