userform qui permet d'ouvrir fichiers excel xls,xlsm

ngexcel

XLDnaute Occasionnel
bonsoir
je reviens après avoir essayé avec excel 2007 mon fichier et j arrive a lister les fichiers excel dans un répertoire
mais j arrive juste a ouvrir les format xls

quelqu un peux regarder le fichier
j'ai besoin d 'aide


help merci
 

Roland_M

XLDnaute Barbatruc
Re : userform qui permet d'ouvrir fichiers excel xls,xlsm

re

voir déjà dans ton autre fil !
 

Pièces jointes

  • FormChoixFichier.xlsm
    21.7 KB · Affichages: 35
  • FormChoixFichier.xlsm
    21.7 KB · Affichages: 41
  • FormChoixFichier.xlsm
    21.7 KB · Affichages: 42

Papou-net

XLDnaute Barbatruc
Re : userform qui permet d'ouvrir fichiers excel xls,xlsm

Bonsoir ngexcel,

Voilà qui devrait régler le problème:

Code:
Private Sub ComboBox1_Change()
    extension = UCase(Mid(Me.ComboBox1, InStr(Me.ComboBox1, ".") + 1))
    Select Case extension
      Case "XLS", "XLSM", "XLSX"
        Workbooks.Open Filename:=Me.ComboBox1
      Case "ppt"
         rep = ActiveWorkbook.Path
         Set Ole = CreateObject("powerpoint.Application")
         Ole.Documents.Open (rep & "\" & Me.ComboBox1)
         Ole.Visible = True
      Case "PDF"
        Fich = Me.ComboBox1
        rep = ActiveWorkbook.Path
        Shell "C:\Program Files (x86)\Adobe\reader 11.0\reader\AcroRd32.exe" & _
           " " & rep & "\" & Fich, vbMaximizedFocus
    End Select
    Unload Me
End Sub
Cordialement.

Edit: Bonsoir Roland_M
 
Dernière édition:

Discussions similaires

Réponses
19
Affichages
2 K

Statistiques des forums

Discussions
312 195
Messages
2 086 078
Membres
103 112
dernier inscrit
cuq-laet