OVH Cloud OVH Cloud

Problème de chemin : rien compris

1 réponse
Avatar
Nicolas
Bonjour,

Je tape les lignes suivantes dans mon code :

Dim CheminFichier as string
CheminFichier=3D"C:\Documents and Settings\Default=20
User\test.xls"
Shell EXCEL.Application.Path & "\EXCEL.exe " &=20
CheminFichier, vbMaximizedFocus

R=E9sultat : =E7a m'affiche 'C:\Documents.xls' introuvable ...
puis 'and.xls' introuvable ...

etc etc

Comment faire ?

On m'a sugg=E9r=E9 de rajouter des guillemets comme ceci :

shell """app.exe"" ""c:\fichier.ext"""

En effet, cela fonctionne mais l=E0 c'=E9tait un cas o=F9 les=20
chemins =E9taient libell=E9s en toute lettre

Comment dois-je faire si mes chemins sont dans des=20
variables tel qu'indiqu=E9 au d=E9but de mon message ?

Merci pour toute aide

Nicolas

1 réponse

Avatar
Zoury
Salut Nicolas! :O)

Essai comme ceci :

<non testé>
'***
Dim CheminFichier as string
CheminFichier="C:Documents and SettingsDefault Usertest.xls"
Call Shell("""" & EXCEL.Application.Path & "EXCEL.exe"" """ & CheminFichier
& """")
'***

--
Cordialement
Yanick Lefebvre - MVP pour Visual Basic
http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/

Merci de poster les réponses au groupe afin d'en faire profiter à tous