Laisson dde

baaachar13 Messages postés 1 Statut Membre -  
dandypunk Messages postés 838 Statut Membre -
Bonjour,
salut comment etablir un connection ou laison dde entre l e word et excel quant everire l'excel sera ouvrira
Configuration: Windows XP
Internet Explorer 6.0

2 réponses

  1. m@rina Messages postés 27610 Date d'inscription   Statut Modérateur Dernière intervention   11 563
     
    Bonjour,

    Menu Outils, Options, Général => cocher l'option "Confirmation des conversions lors de l'ouverture".

    m@rina
    0
  2. dandypunk Messages postés 838 Statut Membre 83
     
    Il faut utiliser DDEInitiate

    A la volée, le code est

    Sub PiloterWordParExcel()
        Dim lCanal As Long
        
        Application.DisplayAlerts = False 'Désactive les messages d'alerte
        'Ouvre le fichier "Toto.DOC" Nb le fichier doit exister
        lCanal = Application.DDEInitiate("Winword", "E:\Documents\Toto.doc")
        'Ajoute du texte au fichier
        Application.DDEExecute lCanal, "Ce texte sera ajouté à Toto.doc"
        'Sauvegarde le fichier TOTO
        Application.DDEExecute lCanal, "[FILESAVE]"
        'Libère le canal
        Application.DDETerminate lCanal
        Application.DisplayAlerts = True
        
    End Sub


    0