Ouvrir fichier texte sur logiciel

N12ico

XLDnaute Nouveau
Bonjour

J'ai utilisé l'instruction SHELL afin d'ouvrir un logiciel qui doit me permettre d’exécuter un code que je crée à partir de VBA excel et que j' enregistre dans un fichier texte.

Ma demande est la suivante:

Après avoir ouvert le logiciel comment faire en sorte que mon fichier texte s'ouvre à l’intérieur du logiciel avec l'aide d'une commande comme un BOUTON par exemple.
 

Pièces jointes

  • test shell.xlsm
    17.8 KB · Affichages: 38

Modeste geedee

XLDnaute Barbatruc
Re : Ouvrir fichier texte sur logiciel

Bonsour®

en argument de l'instruction SHELL, c'est le chemin et nom de ton logiciel qu'il faut mettre... !!!

si ton logiciel accepte un argument en ligne de commande, il est alors envisageable
de completer l'argument d'exécution avec le nom du ficher texte à ouvrir

VB:
Private Sub Ouvrir_prog_Click()
 Unload test_shell
 Application.WindowState = xlMinimized
 rep = Shell("C:\cheminTMCL\TMCL.exe C:\Users\N12ico\MonFichierTMCL.Txt", vbNormalFocus)
End Sub
 
Dernière édition:

Lone-wolf

XLDnaute Barbatruc
Re : Ouvrir fichier texte sur logiciel

Re

Peut-être comme ceci

Code:
Private Sub Ouvrir_prog_Click()
Dim rep$
Unload test_shell
Application.WindowState = xlMinimized
rep = Shell("C:\Windows\notepad.exe C:\Users\N12ico\Main.txt", vbNormalFocus)
End Sub
 
Dernière édition:

Lone-wolf

XLDnaute Barbatruc
Re : Ouvrir fichier texte sur logiciel

Re

une autre façon

Code:
'DANS UN MODULE
Public Const fichier As String = "C:\Windows\notepad.exe C:\Users\N12ico\Main.txt"


Private Sub Ouvrir_prog_Click()
Dim rep$
Unload test_shell
Application.WindowState = xlMinimized
rep = Shell(fichier, vbNormalFocus)
End Sub
 

Modeste geedee

XLDnaute Barbatruc
Re : Ouvrir fichier texte sur logiciel

Bonsour®
Une réponse SVP
pourquoi n'utilises-tu pas :
TMCL-PC
The TMCL/PC-IDE looks very much like the TMCL-IDE. It mainly provides an integrated editor and a TMCL/PC
assembler. It also provides an integrated TMCL/PC interpreter that executes a program that has been assembled
by the TMCL/PC assembler. There are also some powerful debugging facilities (setting breakpoints, inspecting
local variables).
 

Discussions similaires

Statistiques des forums

Discussions
311 725
Messages
2 081 940
Membres
101 845
dernier inscrit
annesof