Ce servir d'un Répertoire sous ftp comme dossier d'extract

Bonsoir,

j'ai un répertoire remplie de Datas sous

et voudrais adaptés ce début de code que voici qui fonctionne sous le Lecteur physique F: de mon Pc.

Par avance Merci d'apporter votre support à ma requête

Bien cordialement

GDS

Sub Fichierecent()

Dim Fso As Object

Dim F As String

Dim Fich As Object

Dim Ladate As Date

Dim Lenom As String

Dim Msg, Style, Title, Response

Set Fso = CreateObject("scripting.filesystemobject")

F = Dir("F:\Done ST sauvegarde\Act-Preal PCA" & "\" & "*.CSV")

While F <> ""

Set Fich = Fso.GetFile("F:\Done ST sauvegarde\Act-Preal PCA" & "\" & F)

If Lenom = "" Then

Ladate = Fich.DateCreated

Lenom = F

Else

A ce jour je n'ai toujours pas trouvé la solution

malgrés des séries d'essais

y a t-il un équivalent à ChDir pour le spécifier que le disque et sous ftp avec User et Password connu

que je déclarerai comme tel:

' paramètres FTP

SiteFTP = "ftp://****"

Utilisateur = "User"

MotDePasse = "PassW"

Merci d'avance pour vos retours

Le sujet requiert un Savoir Excel qui dépasse largement du bidouillage et j'en suis conscient et perso je n'ai pas les compétences

mais désirs savoir et partager

Cordialement

bonjour,

voici ce que j'ai trouvé sur le net

Sub Get_File_From_FTP()
    'Variable Declarion Section
    Dim FTP As Inet

    'Assign Host URL, Source and Destination File path
    HostURL = ThisWorkbook.Sheets(1).Cells(1, 1)
    FileSource = ThisWorkbook.Sheets(1).Cells(1, 2)
    FileDestination = ThisWorkbook.Sheets(1).Cells(2, 2)

    'Create New instance of Object and Assing the Parameters
    Set FTP = New Inet
    With FTP
        .URL = HostURL
        .Protocol = icFTP
        'Replace with your Login and Password Below. Many FTP servers allow Anonymous access with below credentials
        .UserName = "anonymous"
        .Password = "mail@gmail.com"
        .AccessType = icUseDefault
        'Use "Get" to Download and "Put" Option to Upload File to FTP Server
        .Execute .URL, "Get " & FileSource & " " & FileDestination
    End With
    Do While FTP.StillExecuting
        DoEvents
    Loop

    'Status of FTP through Voice Message
    Application.Speech.Speak "Process Completed;" & FTP.ResponseInfo

    If FTP.ResponseCode = 0 Then
        'SomeTime FTP steps will execute successfully, but file will not be there in Destination path
        'Search for the file in the Path mentioned in this Message Box
        MsgBox "File is Copied to :" & VBA.CurDir
    End If
    Set FTP = Nothing
End Sub

pour avoir l'équivalent d'un chdir sur le server ftp

tu devrais essayer la commande cd

      .Execute .URL, "CD le nom du repertoire " 

Merci h2so4

Je vais dés demain essayé ce code, et Merci pour ton précieux support

Bien Cordialement

Gds

Rechercher des sujets similaires à "servir repertoire ftp comme dossier extract"