Solved

Error after installing on other machines

Posted on 2001-06-10
2
187 Views
Last Modified: 2010-05-02
This program copys renames & relocates a file
The program picks up the location of the source file and the destination location from an external text file. This is done incase source or destination directories need to be changed. The problem is that after running the P&D wizard then installing it on another machine (without VB installed) it returns "Error '76' Path Not Found". Both the source & destination directories exist as does the file to be copied. The program doesn't seem to be reading the text file for some reason. The program works without any problems after being installed on my VB machine.
Any help would be much appreciated.

Thanks in advance
AndrewG
0
Comment
Question by:Andrew777
2 Comments
 
LVL 6

Accepted Solution

by:
kahlean earned 50 total points
ID: 6175035
is is due to your source file reside on the different drive on your machine. I meant all your source file might be at the d drive. During istallation the system might refering files from the other drive. Try to place it at the most common c drive

0
 
LVL 4

Expert Comment

by:wileecoy
ID: 6175131
Since you cannot step through the code on these machines to see where the error exists, maybe you can debug the problem by adding either a log file or temporarily, a message box.

I have used both depending on the complexity of the project and the extent of coding that would be necessary.

In all the areas that a path is references (either reading or writing) add a procedure call with the path as a parameter.  For example:

Private sub DebugMessage (sPath as string)

MsgBox sPath

End Sub

Then, in the code where you are getting ready to reference the path:

DebugMessage YourPath

This will display the path that the program is looking for before you get the error message.  You could also include other information such as what are of your code you are in.
For example:

Private sub DebugMessage (sPath as string, sProcedure as string)

MsgBox sPath & ", " & sProcedure

End Sub

when you call the procedure... let's assume you are in the code generated by Command1_Click (clicking a command button)

DebugMessage sPath, "Command1_Click"

-------------------------------------

Alternatively, you could also add error handling to see if the path exists, and if it doesn't - add code to handle the problem as you wish.

For example:

before you use the file add the following...

    Dim sFileNames As String
    Dim sPath As String
    sPath = "C:\autoexec.bat"
    sFileNames = Dir(sPath)
    If sFileNames = "" Then
        MsgBox "File Not Found - " & sPath
    End If

if the file is found the value of sFileNames will be just the name of the file, not the path.

If none of these work - post what other direction you may want to take.



0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now