OVH Cloud OVH Cloud

Pb avec Shell (urgent svp merci)

5 réponses
Avatar
Shewy80
Bonjour à tous.

Je suis dans le caca avec la cde Shell.

En effet je voudrai ouvrir à l'écran un fichier texte (il existe, et je c où
il se trouve)

Quand je test avec :
'fic = Shell("C:\WINDOWS\system32\CALC.EXE", 1) ->> ça marche

'fic =Shell(chemin, vbMaximizedFocus) ->> ça marche pas !!

Je n'y comprend rien

Voici mon code en entier :
Merci d'avance de votre aide tous !
----------------------------------------------------------------------------
-----------------------------------
Dim rep As String
Dim fich As String
Dim chemin As String

rep = Range("tables!Rep_Save").Value -> renvoi : Z:\perso\excel
fich = "InformationTEG.txt"
chemin = rep & "\" & fich ->> Renvoi donc Z:\perso\excel\InformationTEG.txt

Open chemin For Output As #1
Print #1, TextBox1.Text
Close #1

Dim reponse As String
reponse = MsgBox("Contenu sauvegardé dans : " & vbCrLf & _
chemin & vbCrLf & "Voulez ouvrir ce fichier ?", vbInformation +
vbYesNo, "Ouvrir le fichier ?")

Dim fic As String
If reponse = vbYes Then
'fic = Shell("C:\WINDOWS\system32\CALC.EXE", 1)
call Shell(chemin, vbMaximizedFocus)
'Shell chemin, vbNormalFocus
' Shell (chemin)
End If

MsgBox fic

5 réponses

Avatar
Bruno LOUIS
Salut,

Pourquoi tu n'essaies pas : fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE
C:file.txt", vbMaximizedFocus)

Cordialement,

Bruno LOUIS

"Shewy80" a écrit dans le message de news:
ctai3m$8h4$
Bonjour à tous.

Je suis dans le caca avec la cde Shell.

En effet je voudrai ouvrir à l'écran un fichier texte (il existe, et je c

il se trouve)

Quand je test avec :
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1) ->> ça marche

'fic =Shell(chemin, vbMaximizedFocus) ->> ça marche pas !!

Je n'y comprend rien

Voici mon code en entier :
Merci d'avance de votre aide tous !
----------------------------------------------------------------------------
-----------------------------------
Dim rep As String
Dim fich As String
Dim chemin As String

rep = Range("tables!Rep_Save").Value -> renvoi : Z:persoexcel
fich = "InformationTEG.txt"
chemin = rep & "" & fich ->> Renvoi donc
Z:persoexcelInformationTEG.txt

Open chemin For Output As #1
Print #1, TextBox1.Text
Close #1

Dim reponse As String
reponse = MsgBox("Contenu sauvegardé dans : " & vbCrLf & _
chemin & vbCrLf & "Voulez ouvrir ce fichier ?", vbInformation +
vbYesNo, "Ouvrir le fichier ?")

Dim fic As String
If reponse = vbYes Then
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1)
call Shell(chemin, vbMaximizedFocus)
'Shell chemin, vbNormalFocus
' Shell (chemin)
End If

MsgBox fic





Avatar
Shewy80
j'essai mais quand je remplace C:file.txt par ma variable :' chemin '
ça ne marche pas, g une erreur
et fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE chemin", vbMaximizedFocus)
m'ouvre un nouveau fichier TXT nomé Chemin et non pas mon fichier texte.


"Bruno LOUIS" a écrit dans le message de
news:41f8d985$0$28958$
Salut,

Pourquoi tu n'essaies pas : fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE
C:file.txt", vbMaximizedFocus)

Cordialement,

Bruno LOUIS

"Shewy80" a écrit dans le message de news:
ctai3m$8h4$
Bonjour à tous.

Je suis dans le caca avec la cde Shell.

En effet je voudrai ouvrir à l'écran un fichier texte (il existe, et je
c



il se trouve)

Quand je test avec :
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1) ->> ça marche

'fic =Shell(chemin, vbMaximizedFocus) ->> ça marche pas !!

Je n'y comprend rien

Voici mon code en entier :
Merci d'avance de votre aide tous !


--------------------------------------------------------------------------
--

-----------------------------------
Dim rep As String
Dim fich As String
Dim chemin As String

rep = Range("tables!Rep_Save").Value -> renvoi : Z:persoexcel
fich = "InformationTEG.txt"
chemin = rep & "" & fich ->> Renvoi donc
Z:persoexcelInformationTEG.txt

Open chemin For Output As #1
Print #1, TextBox1.Text
Close #1

Dim reponse As String
reponse = MsgBox("Contenu sauvegardé dans : " & vbCrLf & _
chemin & vbCrLf & "Voulez ouvrir ce fichier ?", vbInformation
+


vbYesNo, "Ouvrir le fichier ?")

Dim fic As String
If reponse = vbYes Then
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1)
call Shell(chemin, vbMaximizedFocus)
'Shell chemin, vbNormalFocus
' Shell (chemin)
End If

MsgBox fic









Avatar
gilbert
Bonjour

comme cela

Sub chem()
chemin = "c:file.txt"
fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE " & chemin)
End Sub


salutations

Gilbert


"Shewy80" a écrit dans le message de
news:ctampc$55f$
j'essai mais quand je remplace C:file.txt par ma variable :' chemin '
ça ne marche pas, g une erreur
et fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE chemin", vbMaximizedFocus)
m'ouvre un nouveau fichier TXT nomé Chemin et non pas mon fichier texte.


"Bruno LOUIS" a écrit dans le message de
news:41f8d985$0$28958$
Salut,

Pourquoi tu n'essaies pas : fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE
C:file.txt", vbMaximizedFocus)

Cordialement,

Bruno LOUIS

"Shewy80" a écrit dans le message de news:
ctai3m$8h4$
Bonjour à tous.

Je suis dans le caca avec la cde Shell.

En effet je voudrai ouvrir à l'écran un fichier texte (il existe, et
je



c

il se trouve)

Quand je test avec :
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1) ->> ça marche

'fic =Shell(chemin, vbMaximizedFocus) ->> ça marche pas !!

Je n'y comprend rien

Voici mon code en entier :
Merci d'avance de votre aide tous !




--------------------------------------------------------------------------
--
-----------------------------------
Dim rep As String
Dim fich As String
Dim chemin As String

rep = Range("tables!Rep_Save").Value -> renvoi : Z:persoexcel
fich = "InformationTEG.txt"
chemin = rep & "" & fich ->> Renvoi donc
Z:persoexcelInformationTEG.txt

Open chemin For Output As #1
Print #1, TextBox1.Text
Close #1

Dim reponse As String
reponse = MsgBox("Contenu sauvegardé dans : " & vbCrLf & _
chemin & vbCrLf & "Voulez ouvrir ce fichier ?",
vbInformation



+
vbYesNo, "Ouvrir le fichier ?")

Dim fic As String
If reponse = vbYes Then
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1)
call Shell(chemin, vbMaximizedFocus)
'Shell chemin, vbNormalFocus
' Shell (chemin)
End If

MsgBox fic













Avatar
Alain CROS
Bonjour.

Essayer :
fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE " & chemin, vbMaximizedFocus)

Alain CROS

"Shewy80" a écrit dans le message de news: ctampc$55f$
j'essai mais quand je remplace C:file.txt par ma variable :' chemin '
ça ne marche pas, g une erreur
et fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE chemin", vbMaximizedFocus)
m'ouvre un nouveau fichier TXT nomé Chemin et non pas mon fichier texte.


"Bruno LOUIS" a écrit dans le message de
news:41f8d985$0$28958$
Salut,

Pourquoi tu n'essaies pas : fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE
C:file.txt", vbMaximizedFocus)

Cordialement,

Bruno LOUIS

"Shewy80" a écrit dans le message de news:
ctai3m$8h4$
Bonjour à tous.

Je suis dans le caca avec la cde Shell.

En effet je voudrai ouvrir à l'écran un fichier texte (il existe, et je
c



il se trouve)

Quand je test avec :
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1) ->> ça marche

'fic =Shell(chemin, vbMaximizedFocus) ->> ça marche pas !!

Je n'y comprend rien

Voici mon code en entier :
Merci d'avance de votre aide tous !


--------------------------------------------------------------------------
--

-----------------------------------
Dim rep As String
Dim fich As String
Dim chemin As String

rep = Range("tables!Rep_Save").Value -> renvoi : Z:persoexcel
fich = "InformationTEG.txt"
chemin = rep & "" & fich ->> Renvoi donc
Z:persoexcelInformationTEG.txt

Open chemin For Output As #1
Print #1, TextBox1.Text
Close #1

Dim reponse As String
reponse = MsgBox("Contenu sauvegardé dans : " & vbCrLf & _
chemin & vbCrLf & "Voulez ouvrir ce fichier ?", vbInformation
+


vbYesNo, "Ouvrir le fichier ?")

Dim fic As String
If reponse = vbYes Then
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1)
call Shell(chemin, vbMaximizedFocus)
'Shell chemin, vbNormalFocus
' Shell (chemin)
End If

MsgBox fic













Avatar
Shewy80
ça marche nikel !!
Merci beaucoup beaucoup !!


"Alain CROS" a écrit dans le message de
news:
Bonjour.

Essayer :
fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE " & chemin, vbMaximizedFocus)

Alain CROS

"Shewy80" a écrit dans le message de news:
ctampc$55f$

j'essai mais quand je remplace C:file.txt par ma variable :' chemin '
ça ne marche pas, g une erreur
et fic = Shell("C:WINDOWSsystem32NOTEPAD.EXE chemin",
vbMaximizedFocus)


m'ouvre un nouveau fichier TXT nomé Chemin et non pas mon fichier texte.


"Bruno LOUIS" a écrit dans le message de
news:41f8d985$0$28958$
Salut,

Pourquoi tu n'essaies pas : fic Shell("C:WINDOWSsystem32NOTEPAD.EXE
C:file.txt", vbMaximizedFocus)

Cordialement,

Bruno LOUIS

"Shewy80" a écrit dans le message de news:
ctai3m$8h4$
Bonjour à tous.

Je suis dans le caca avec la cde Shell.

En effet je voudrai ouvrir à l'écran un fichier texte (il existe, et
je




c

il se trouve)

Quand je test avec :
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1) ->> ça marche

'fic =Shell(chemin, vbMaximizedFocus) ->> ça marche pas !!

Je n'y comprend rien

Voici mon code en entier :
Merci d'avance de votre aide tous !




--------------------------------------------------------------------------

--
-----------------------------------
Dim rep As String
Dim fich As String
Dim chemin As String

rep = Range("tables!Rep_Save").Value -> renvoi : Z:persoexcel
fich = "InformationTEG.txt"
chemin = rep & "" & fich ->> Renvoi donc
Z:persoexcelInformationTEG.txt

Open chemin For Output As #1
Print #1, TextBox1.Text
Close #1

Dim reponse As String
reponse = MsgBox("Contenu sauvegardé dans : " & vbCrLf & _
chemin & vbCrLf & "Voulez ouvrir ce fichier ?",
vbInformation




+
vbYesNo, "Ouvrir le fichier ?")

Dim fic As String
If reponse = vbYes Then
'fic = Shell("C:WINDOWSsystem32CALC.EXE", 1)
call Shell(chemin, vbMaximizedFocus)
'Shell chemin, vbNormalFocus
' Shell (chemin)
End If

MsgBox fic