Bonjour à tous !
Voilà j'aimerais faire marcher mes trois boutons de mon interface mais y'a rien n'a faire je n'y arrive pas. Mon but serez d'ouvrir les fichiers présent dans la filelistebox (que se soit .doc ou .xls) avec word ou excel suivant leur extension.
Il y a un bouton ouvrir -> Lecture seul
modifier-> Ouverture
imprime-> commondialog
Voici mon code:
[i]
Private Sub Cbo_TAR_Click()
Select Case Me.Cbo_TAR.Text
Case "Chabal (Fonderie)"
File1.Path = "C:\Users\Antoine\Desktop\STAGE\CHABAL"
Case "DSR (Tôlerie)"
File1.Path = "C:\Users\Antoine\Desktop\STAGE\DSR"
Case "PF 301 (Filage)"
File1.Path = "C:\Users\Antoine\Desktop\STAGE\PF301"
Case "F 132 (Fonderie refusion copeaux)"
File1.Path = "C:\Users\Antoine\Desktop\STAGE\F132"
Case "F 212/219 (Atelier Tôles Fortes)"
File1.Path = "C:\Users\Antoine\Desktop\STAGE\F212-219"
Case "F 230 (Atelier Tôles Fortes)"
File1.Path = "C:\Users\Antoine\Desktop\STAGE\F230"
Case "F 233 (Atelier Tôles Fortes)"
File1.Path = "C:\Users\Antoine\Desktop\STAGE\F233"
Case "F 235 (Atelier Tôles Fortes)"
File1.Path = "C:\Users\Antoine\Desktop\STAGE\F235"
End Select
End Sub
Private Sub Cmd_imprimer_Click(Index As Integer)
CD_imp.ShowPrinter
End Sub
Private Sub Cmd_modifier_Click(Index As Integer)
Dim wb As Workbook
Dim ws As Worksheet
Dim vas As Variant
Set xlApp = New Excel.Application
Set wb
xlApp.Workbooks.Open("C:\Users\Antoine\Desktop\STAGE" & File1.FileName, xlApp.Visible True)
End Sub
Private Sub Cmd_ouvrir_Click()
Dim wb As Workbook
Dim ws As Worksheet
Dim vas As Variant
Set xlApp = New Excel.Application
Set wb
xlApp.Workbooks.Open("C:\Users\Antoine\Desktop\STAGE" & File1.FileName, ReadOnly True)
End Sub
Private Sub Form_Load()
Lbl_1.Caption = "Sélectionner une tour aéroréfrigérante :"
Cbo_TAR.AddItem "Veuillez sélectionne une TAR", 0
Cbo_TAR.AddItem "Chabal (Fonderie)", 1
Cbo_TAR.AddItem "DSR (Tôlerie)", 2
Cbo_TAR.AddItem "PF 301 (Filage)", 3
Cbo_TAR.AddItem "F 132 (Fonderie refusion copeaux)", 4
Cbo_TAR.AddItem "F 212/219 (Atelier Tôles Fortes)", 5
Cbo_TAR.AddItem "F 230 (Atelier Tôles Fortes)", 6
Cbo_TAR.AddItem "F 233 (Atelier Tôles Fortes)", 7
Cbo_TAR.AddItem "F 235 (Atelier Tôles Fortes)", 8
Cbo_TAR.ListIndex = 0
Img1.Picture = LoadPicture(App.Path & "\plan.jpg")
End Sub
/i
Merci d'avance pour votre aide.