Results 1 to 11 of 11

Thread: Path NOT Found error #76

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    8

    Unhappy Path NOT Found error #76

    Hi this is my first time using this thread to actually get help for my problem from VB HELL. I have the following excerpt of my code below and im using it to obtaine the pictures from USER ACCOUNT PICTURES:

    Dim fso As New FileSystemObject
    Dim Path_to_Folder As String
    Dim Path_Info_to_Pass As String

    Path_to_Folder = Left$(App.Path, InStrRev(App.Path, "\", InStrRev(App.Path, "\"))) & "All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"

    Path_Info_to_Pass = Path_to_Folder

    ****** NOTE ***********
    '_______________________________________
    Call Get_Files(fso.getfolder(Path_Info_to_Pass))
    '_______________________________________

    As soon as i get to the above line, i get error # 76 "Path not found"

    I dont understand why this keeps getting generated. Although when hard-code the whole sections like below:


    Dim fso As New FileSystemObject
    Dim Path_to_Folder As String
    Dim Path_Info_to_Pass As String


    ******* NOTE **********

    '______________________________________________

    'Path_Info_to_Pass = "C:\Documents and Settings\All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"

    '______________________________________________

    Call Get_Files(fso.getfolder(Path_Info_to_Pass))


    When i hard-code the path above, VB does not generate any errors. My problem is that i dont want to hard-code the path because the USER ACCOUNT PICTURES can be somewhere else. Can someone please tell me what im doing wrong? Thanks in advance.

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    8

    Please help! Error #76

    Hi, thanks for your help. The value of Path_to_Folder is

    "C:\Documents and Settings\All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"

  4. #4
    Addicted Member
    Join Date
    Jan 2003
    Posts
    163
    fso.getfolder does not return a folder, it returns a folder object

  5. #5

  6. #6
    Addicted Member
    Join Date
    Jan 2003
    Posts
    163
    i am assuming that Get_Files is your own routine - it looks like it's expecting a string that contains the path to the folder of interest. using fso.getfolder you are passing in a folder object and not a folder path.

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    8

    Error #76 Path Not Found

    Yeah but i dont understand how using the line below, i get the following string:

    ***************************************

    Path_Info_to_Pass = "C:\Documents and Settings\All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"

    Call Get_Files(fso.getfolder(Path_Info_to_Pass))

    ***************************************

    same string as if i were to use the following code:

    ***************************************

    Path_to_Folder = Left$(App.Path, InStrRev(App.Path, "\", InStrRev(App.Path, "\"))) & "All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"

    Path_Info_to_Pass = Path_to_Folder

    Call Get_Files(fso.getfolder(Path_Info_to_Pass))
    'This is where the error occurs (#76)


    ***************************************

    Both of those lines return the same path which is:

    C:\Documents and Settings\All Users.WINDOWS\Application Data\Microsoft\User Account Pictures




    And i know its the EXACT same string being generated because i pass the "Path_to_Folder" string to "text1.text" to see what's being passed and its same as the string in "Path_Info_to_Pass"
    I AM SOOOO CONFUSED!!!!

  8. #8

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    8

    Error # 76 DOOOFUS rite here!

    I am extremly sorry for providing the wrong information. Let me explain which code provides which PATH:

    ***************Code 1*****************


    Private Sub command1_click()

    Dim fso As New FileSystemObject
    Dim Path_to_Folder As String
    Dim Path_Info_to_Pass As String

    Path_to_Folder = Left$(App.Path, InStrRev(App.Path, "\", InStrRev(App.Path, "\"))) & "All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"


    Path_Info_to_Pass = Path_to_Folder

    Text1.Text = Path_to_Folder

    Call Get_Files(fso.getfolder(Path_Info_to_Pass))

    -----------------------------------------------------------------
    Above code passes this string below:


    "C:\Documents and Settings\*Current Logged-on User*\Desktop\
    All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"

    * * Name of current logg-on account appears.


    ***************Code 2*****************

    Private Sub command1_click()

    Dim fso As New FileSystemObject
    Dim Path_to_Folder As String
    Dim Path_Info_to_Pass As String

    Path_Info_to_Pass = "C:\Documents and Settings\All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"

    Call Get_Files(fso.getfolder(Path_Info_to_Pass))

    -----------------------------------------------------------------
    Above code passes this string below:


    "C:\Documents and Settings\All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"



    *********************************************

    So here it is, i messed up in trying to explain it to you guys, you were right **Martin** i was not sure. But there u have it, the only difference that i can tell between the 2 paths is that the first method for some reason includes the CURRENT USER's name and DESKTOP in the path:

    "C:\Documents and Settings\CURRENT USER\DESKTOP\
    All Users.WINDOWS\Application Data\Microsoft\User Account Pictures"


    Please help. Thanks again to those who replied.

  9. #9

  10. #10
    Hyperactive Member Dmitri K's Avatar
    Join Date
    Sep 2002
    Location
    West Palm Beach, FL
    Posts
    444
    Umm if I'm not mistaken, a full directory path is (for example), "c:\hello world\", not c:\hello world". I'm not sure if this is the problem here but I definitely had problems with this before where "\" was not attached to the end of the folder path.

  11. #11

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    8

    Error #76

    Thanks to all for your help. I still have the error, form some reason App.Path keeps looking in to the current logged on user's directory instead of the directory i want.

    Basically i want to be able to allow the user to enter a name to search after specifying if the user is searching for a FILE or FOLDER. I dont want to put anything on the form except a text box to input the NAME and 2 radio buttons for the user to pick what he's searching, whether its a FILE or a FOLDER. Thanks again to everyone who tried.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width