+ Reply to Thread
Results 1 to 10 of 10

Fill listbox with Array of folders

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Fill listbox with Array of folders

    (Modifying some code by Leith Ross) I am stumbling why I get an error trying to fill the listbox with folder names. (See code in red for error location)

    Run time 'error' 53:
    File not found
    If I ommit "& sCustomer" it works? I want the list from sCustomer. Which is just a list of sub folders.
    Please Login or Register  to view this content.
    The path sFolderPath exists as shown, sCustomer is selected from an optionbutton and is hardcoded so that name exists as well.

    Any hints, tips or examples are welcome.
    Last edited by Rick_Stanich; 01-26-2010 at 01:10 PM.
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Fill listbox with Array of folders

    I have doubled up on the last folder name in my path string....Now to figure out why.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Fill listbox with Array of folders

    Does sCustomer have a backslash on the end of it?
    Remember what the dormouse said
    Feed your head

  4. #4
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Fill listbox with Array of folders

    No, it is a folder name only such as:
    Example
    Please Login or Register  to view this content.
    The folder tree is:
    F:\CNC Mill\#19 CNC CMM\Inspection Reports\"
    then sCustomer which is;
    "Test"
    Then some sub folders.

    The sub folders are my target.

    I thought that this section of code:
    Please Login or Register  to view this content.
    Would begin the first name of the subfolders from sCustomer, it doesnt, it begins with sCustomer itself.
    Thus I am getting a target path of:
    F:\CNC Mill\#19 CNC CMM\Inspection Reports\TestTest"
    An invalid name.

    If I remove "& sFolderName" from:
    Please Login or Register  to view this content.
    Then I get a single entry in the listbox as "Test".
    Last edited by Rick_Stanich; 01-26-2010 at 12:34 PM.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Fill listbox with Array of folders

    If sCustomer does not end in a backslash, then this:
    Please Login or Register  to view this content.
    needs to be this:
    Please Login or Register  to view this content.
    which is what I was hinting at...

  6. #6
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Fill listbox with Array of folders

    I believe I tried that and it resulted in
    F:\CNC Mill\#19 CNC CMM\Inspection Reports\Test\Test
    Still invalid.

    If I change to this:
    Please Login or Register  to view this content.
    I get the same thing!?

    I may be lost. LOL
    sigh...

    {head scratch}

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Fill listbox with Array of folders

    Try this:
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Fill listbox with Array of folders

    That was it? All the code needed was "& "\""a the end of:
    Please Login or Register  to view this content.
    [Palm to forehead]
    Smack!
    [/Palm to forehead]

    I looked at every angle but that.
    Thanks for the help!
    Im sorry I am not allowed to add to your rep, we are limited some how.

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Fill listbox with Array of folders

    Yep - otherwise the Dir looks for that folder name, not in that folder.

  10. #10
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Fill listbox with Array of folders

    Quote Originally Posted by romperstomper View Post
    Yep - otherwise the Dir looks for that folder name, not in that folder.
    Some how, I missed that part.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1