Ouvrir un fichier avec une macro

Bonjour,

j'ai un nom saisi dans une cellule (par exemple ABCD, dans la cellule B14) et je souhaiterais ouvrir le fichier ABCD.txt présent dans C:\Dossier\ABCD.txt.

J'ai la structure qui est:

        Set wshell = CreateObject("WScript.Shell")
        wshell.Run "C:\blabla.txt"

Mais quand je met:

        Set wshell = CreateObject("WScript.Shell")
        wshell.Run "C:\&B14.Value&.txt"

Et bah ça colle pas ...

Si je mets:

        Set wshell = CreateObject("WScript.Shell")
        wshell.Run "C:\ & B14.Value & .txt"

Il m'ouvre que le C:\

Pouvez-vous m'aider ?

Cordialement

Essaie comme ça plutôt :

Set wshell = CreateObject("WScript.Shell")
        wshell.Run "C:\" & [B14].Value & ".txt"
vba-new a écrit :

Essaie comme ça plutôt :

Set wshell = CreateObject("WScript.Shell")
        wshell.Run "C:\" & [B14].Value & ".txt"

Salut,

Bingo, merci bien !!

A+

Rechercher des sujets similaires à "ouvrir fichier macro"