ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Error: Method OpenTextFile of IFilesystem3 failed (https://www.excelbanter.com/excel-programming/323797-vba-error-method-opentextfile-ifilesystem3-failed.html)

Learner[_3_]

VBA Error: Method OpenTextFile of IFilesystem3 failed
 
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

I found that it throws error in the OpenTextFile mothod above..

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



All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com