IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

Envoyer un fichier depuis mon PC vers le ftp d'un serveur


Sujet :

Macros et VBA Excel

  1. #41
    Invité
    Invité(e)
    Par défaut
    et dans script.ftp tu as bien le résultat de ça?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    cript =environ("TEMP") & "\script.ftp"
            Open Script For Output As #1
            Print #1, "user"
            Print #1, strUserName
            Print #1, strPassword
            Print #1, "cd FDM/FDMRIP"
            Print #1, "put " & fdmca
            Print #1, "Quit"
            Close #1

  2. #42
    Nouveau Candidat au Club
    Homme Profil pro
    debutant informatque
    Inscrit en
    Avril 2015
    Messages
    27
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : debutant informatque

    Informations forums :
    Inscription : Avril 2015
    Messages : 27
    Points : 1
    Points
    1
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
     'enregistrement de la FDM à envoyer par FTP
            are = Left(Worksheets(1).Range("L2"), 3)
            fdm = "C:\TEMP\" & Range("L2") & ".xls"
            ThisWorkbook.SaveAs (fdm)
     
            strPassword = "xxxx"
            strUserName = "xxxxxxxxxxxxxx"
            ftpServer = "o xxxxx.xxx.xxx.xxx.fr"
            ' creation du script FTP et enregistrement provisoire
            script = Environ("TEMP") & "\script.ftp"
            Open script For Output As #1
            Print #1, ftpServer
            Print #1, strUserName
            Print #1, strPassword
            Print #1, "cd FDM"
            Print #1, "put " & fdm
            Print #1, "cd FDM/FCMOCSV"
            Print #1, "put " & stF
            Print #1, "quit"
            Close #1
            Shell "ftp -n -s:" & Chr(34) & script & Chr(34) & Space(1) & ftpServer
    Résultat:
    Aïe, le fichier script.ftp ne s'est pas créé

  3. #43
    Invité
    Invité(e)
    Par défaut
    pour le test faits le à la mais avec Notepad++

  4. #44
    Nouveau Candidat au Club
    Homme Profil pro
    debutant informatque
    Inscrit en
    Avril 2015
    Messages
    27
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : debutant informatque

    Informations forums :
    Inscription : Avril 2015
    Messages : 27
    Points : 1
    Points
    1
    Par défaut
    Peut pas l'installer PC entreprise!!!!!

  5. #45
    Invité
    Invité(e)
    Par défaut
    Nopad normal

  6. #46
    Nouveau Candidat au Club
    Homme Profil pro
    debutant informatque
    Inscrit en
    Avril 2015
    Messages
    27
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : debutant informatque

    Informations forums :
    Inscription : Avril 2015
    Messages : 27
    Points : 1
    Points
    1
    Par défaut
    Je ne m'en sort pas c'est trop hard pour moi, je croix que je vais arrêter

  7. #47
    Invité
    Invité(e)
    Par défaut
    dans Excel Vba!
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    Sub test()
    strPassword = "123456789"
    strUserName = "Testr"
    ftpServer = "o ****.**.**.***.fr"
    Script = Environ("TEMP") & "\script.ftp"
            Open Script For Output As #1
            Print #1, "user"
            Print #1, strUserName
            Print #1, strPassword
            Print #1, "cd FDM/FDMRIP"
            Print #1, "put " & fdmca
            Print #1, "Quit"
            Close #1
    Open Environ("TEMP") & "\script.Bat" For Output As #1
     Print #1, "ftp -n -s:" & Chr(34) & Script & Chr(34) & Space(1) & ftpServer
     Print #1, "Pause"
     Close #1
    shell Environ("TEMP") & "\script.Bat"
     MsgBox Environ("TEMP") & "\script.Bat"
     
    End Sub

  8. #48
    Nouveau Candidat au Club
    Homme Profil pro
    debutant informatque
    Inscrit en
    Avril 2015
    Messages
    27
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : debutant informatque

    Informations forums :
    Inscription : Avril 2015
    Messages : 27
    Points : 1
    Points
    1
    Par défaut
    resultat de ton code:
    création d'un script.ftp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    user
    Testr
    123456789
    cd FDM/FDMRIP
    put 
    Quit
    et il me crée aussi un script.bat

    sous C:\Users\xxxxx\AppData\Local\Temp

  9. #49
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par fthemi Voir le message
    r
    il me crée aussi un script.bat

    sous C:\Users\xxxxx\AppData\Local\Temp
    oui c'est pour lire le résultat dans la fenêtre DOS!

  10. #50
    Nouveau Candidat au Club
    Homme Profil pro
    debutant informatque
    Inscrit en
    Avril 2015
    Messages
    27
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : debutant informatque

    Informations forums :
    Inscription : Avril 2015
    Messages : 27
    Points : 1
    Points
    1
    Par défaut
    Résultat en fichier joint
    Fichiers attachés Fichiers attachés

  11. #51
    Invité
    Invité(e)
    Par défaut
    Oui maintenant place les valeur de ton serveur et to fichier!
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    Sub test()
    strPassword ="tonPassword"
    strUserName = "toUserName"
    ftpServer ="TonServeurFtp.fr"
    fdmca ="TonFichier.xls"
    Script = Environ("TEMP") & "\script.ftp"
            Open Script For Output As #1
            Print #1, "user"
            Print #1, strUserName
            Print #1, strPassword
            Print #1, "cd FDM/FDMRIP"
            Print #1, "put " & fdmca
            Print #1, "Quit"
            Close #1
    Open Environ("TEMP") & "\script.Bat" For Output As #1
     Print #1, "ftp -n -s:" & Chr(34) & Script & Chr(34) & Space(1) & ftpServer
     Print #1, "Pause"
     Close #1
    shell Environ("TEMP") & "\script.Bat"
     MsgBox Environ("TEMP") & "\script.Bat"
     
    End Sub

  12. #52
    Nouveau Candidat au Club
    Homme Profil pro
    debutant informatque
    Inscrit en
    Avril 2015
    Messages
    27
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : debutant informatque

    Informations forums :
    Inscription : Avril 2015
    Messages : 27
    Points : 1
    Points
    1
    Par défaut
    Alors, même résultat que toute à l'heure dans le .bat (avec la vrai adresse du serveur)
    et voila le script.ftp
    user
    Administrateur
    edfgdf
    cd FDM/FDMRIP
    put 000ACR119397_1-1.xls
    Quit

    Mais le fichier;xls ne se trouve pas dans le dossier FDMRIP du SERVEUR

  13. #53
    Invité
    Invité(e)
    Par défaut
    tu arrives à te connecté avec un client ftp ou internet explorer?

  14. #54
    Nouveau Candidat au Club
    Homme Profil pro
    debutant informatque
    Inscrit en
    Avril 2015
    Messages
    27
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Aveyron (Midi Pyrénées)

    Informations professionnelles :
    Activité : debutant informatque

    Informations forums :
    Inscription : Avril 2015
    Messages : 27
    Points : 1
    Points
    1
    Par défaut
    e suis avec IE9 sur mon bureautique
    comment veux tu dires?
    mais je ne suis plus au boulot, j'y serait jeudi
    Merci pour ta disponibilité

  15. #55
    Expert éminent sénior


    Profil pro
    Inscrit en
    Juin 2003
    Messages
    14 008
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 14 008
    Points : 20 038
    Points
    20 038
    Par défaut
    bonsoir,

    on en reviens au message 22 ...:

    Citation Envoyé par bbil Voir le message
    non pas sur le serveur installe le client ftp sur ton PC cela te permettra de mieux visualiser ton serveur .. vu qu'il semble que tu ne sache pas si le fichier est transféré ou pas ...


    si tu ne veux pas l'installer tu peu aussi utiliser ftp.exe en ligne de commande ... tu as l'aide en ligne accessible par la commande help... après avoir lancé ftp.exe

Discussions similaires

  1. Envoyer un fichier depuis AS vers une servlet
    Par nebrass dans le forum ActionScript 3
    Réponses: 0
    Dernier message: 16/09/2013, 16h54
  2. Envoyer des données depuis mon application android vers mysql
    Par bennour.mohamed dans le forum Android
    Réponses: 9
    Dernier message: 18/07/2011, 14h42
  3. envoyer des sms de mon programme ver un portable
    Par Nadirov dans le forum Delphi
    Réponses: 3
    Dernier message: 14/08/2006, 16h29
  4. Serveur/Client UDP: comment envoyer un fichier avec mon code
    Par danje dans le forum Entrée/Sortie
    Réponses: 7
    Dernier message: 21/12/2005, 14h54
  5. Réponses: 3
    Dernier message: 29/10/2004, 13h54

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo