I am using the following code to successfully access an .ini file which contains a path name, when running my vb6 application from within the directory it is installed (using an installation program):-

MsgBox ("The current App.Path before chdir is now:" & App.Path)
ChDir App.Path
MsgBox ("The current App.Path after chdir is now:" & App.Path)

pass_Path$ = "wordpathfour.txt"
Open pass_Path$ For Input As #1
'On Error GoTo File_Not_Present
Line Input #1, LineOfText$
pass_Path1$ = LineOfText$
Close #1

The problem I am having is that if I run my VB6.exe (in essence a file location gui) from the windows toolbar after installation, for all the executable appears to be looking in the correct place (from path information in the msgboxes immediatley prior to trying to open the file), error number 53 is returned, file not found ? My exe then exits.....

If I resort to running the exe from the directory again (as opposed to the programs toolbar), the file, which exists is located, and the associated form happily loads.

Why does my VB6 executable have problems opening a file when every indication that I can get is that it is looking in the right place and the file exists.... I do write to the file in question not long before trying to read it in again, is it possible that when running from the programs menu bar that I need a delay inserted to allow sufficient time for the file to close before re-reading it ?

Help....