+ Reply to Thread
Results 1 to 10 of 10

Unable to use the "Dir" function for a FTP folder

  1. #1
    Registered User
    Join Date
    03-12-2015
    Location
    germany
    MS-Off Ver
    2007
    Posts
    8

    Unable to use the "Dir" function for a FTP folder

    Hi,

    I'm using the "Dir" function to determine if a specified folder exists on my pc locally and if not I create a new one with that name:

    If Len(Dir(Path, vbDirectory)) = 0 Then

    MkDir Path

    End If

    For example Path = "C:\list\doesthisfolderexist"

    It is working fine. But now I wanted to use this function for a FTP folder that is already connected to windows 7.

    For example with this FTP Path = "ftp://123.123.123.123:321/list/doesthisfolderexist" it does not work.

    Of course I copied the filepaths to my explorer to check if they are correct and it is working fine.

    Can someone tell me why the "Dir" function is working with my local filepath but not with the ftp filepath?

    Thank you!

    I also posted this question here: http://www.mrexcel.com/forum/excel-q...ml#post4099808
    Last edited by flextexmex; 03-12-2015 at 06:32 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Unable to use the "Dir" function for a FTP folder

    Ta muchly
    Last edited by Kyle123; 03-12-2015 at 06:33 AM.

  3. #3
    Registered User
    Join Date
    03-12-2015
    Location
    germany
    MS-Off Ver
    2007
    Posts
    8

    Re: Unable to use the "Dir" function for a FTP folder

    Ok Sorry for that! I have added the link

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Unable to use the "Dir" function for a FTP folder

    The Dir function doesn't work like that, I suspect not, but does it work if you map the ftp drive and use the letter alias?

  5. #5
    Registered User
    Join Date
    03-12-2015
    Location
    germany
    MS-Off Ver
    2007
    Posts
    8

    Re: Unable to use the "Dir" function for a FTP folder

    How do you mean that exactly?

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Unable to use the "Dir" function for a FTP folder

    Map the drive in Windows Explorer, then Dir("J:\list\DoesThisFoderExist",vbDirectory)

  7. #7
    Registered User
    Join Date
    03-12-2015
    Location
    germany
    MS-Off Ver
    2007
    Posts
    8

    Re: Unable to use the "Dir" function for a FTP folder

    I mapped it but it still doesnt work. I'm not sure if "Dir" works for FTP folders at all.

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Unable to use the "Dir" function for a FTP folder

    I ddn't think it would, but worth a try

  9. #9
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Unable to use the "Dir" function for a FTP folder

    Deleted a bad answer.

    Lewis
    Last edited by LJMetzger; 03-14-2015 at 11:10 AM. Reason: Deleted bad answer - I had ftp confused with pseudo-ftp I did from an http site. Thank you Kyle123 for showing me my error.

  10. #10
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Unable to use the "Dir" function for a FTP folder

    Hi Lewis, think you missed that this is ftp, not http

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Script to save to folder in "v:\dept2", confirm file saved, then delete from "v:\dept1"
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2014, 11:42 AM
  2. Unable to run code in between "Unprotect" and "Protect" object.
    By eric1234 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-28-2013, 12:44 PM
  3. Unable to implement "IF" Function / Formula in Excel (workbook attached)
    By Swapna Thakur in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-01-2012, 02:02 AM
  4. "Unable to get the RTD property of the worksheet function class"
    By billiboy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2009, 11:07 AM
  5. Backup to specific folder if workbook names begins with "NSR" or "MAC"
    By GregR in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-05-2005, 08:06 PM

Tags for this Thread

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