Run Time Error


I created a setup program using the setup wizard of VB-5.0

After setup the program I tried to run it (in the same computer which the program was writed), I got en error mesage box such as: "Run-time error '76': Path not found"

What could be wrong and how can I fix it ???
Who is Participating?
yronnenConnect With a Mentor Commented:
So why didn't you say so??

It's very simple. Error 76 means that your app is trying to call an external file which is not there.

Few solutions:
1. If the file is in the application directory (where the exe file is), use the app.path value which returns the exe directory. For example, if your app is at c:\program files\myapp\myapp.exe, you can use:
dim s as string
The value of s will be "c:\program files\myapp".
2. If the file is at a different location, a good solution will be to show the open file dialog at the first time to find the required file, and keep it's location in the registry, so the application will know where to find the file by itself next time.

Both of the above solutions require only few lines of code.
s_lavieAuthor Commented:
I'm not sure I understand were exactly should I specify the paths. Is it in the program itself or in the setup wizard. I tried to add them in the wizard in the 'File Summery' phase, but it didn't help. Please be more detailed in your unswer and give an example if possible.

s_lavieAuthor Commented:
Sorry but it didn't work, so I have to reject your unswer and give someone else (or yourself) another chance
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

s_lavieAuthor Commented:
I have tried to install in another PC, and the error was the same. Maybe I didn't understand your unswer as it is, so try an example.
Does your program addresses an external file? A database or other data file?
s_lavieAuthor Commented:
I've checked my program, and I'm tring to open a total of 8 files, all have a full path (and all files exist). Could it be a problam of loading icons (when the path defined in the object's property)???
Is there any way to realize what file makes that error???
Are you treating the icons as seperate files? Or do you mean vb's icons?

What I mean is that if you mean that the problem is with the form.icon (for example), than the answer is no. In this case the icons become part of the exe file.

It is what I've told you before. You have a wrong path to a file (or maybe mistyped the name of the file itself).

You can add some extra debuggin after each line to get the filename that gives you the troubles.
s_lavieAuthor Commented:
If I get you right, that error should have been appear also when I'm runnig the appl during development - but it dosn't, so all file names are correct arn't they???
What I like to know is, if it is possible for me to know the name of file that cause that error during runtime.
s_lavieAuthor Commented:
I found the bug - but I don't understand it. It was as this:

Private sub some_sub()

dir1.path = dir2.path + "subdir"
' the error was here but only in runtime

End sub

Private sub Form_load()

dir2.path = "dir"


End sub

I solve it as I put   dir1.path = dir2.path   in Form_load()
after the line   dir2.path = "dir"

yronnen you didn't solve my problam, but you gave me a direction - thanks

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.