Bonjour,
d'après ton premier code, je ne vois pas trop de liaisons entre le fichier, et les options.
Donc, il faudra bien que tu listes toutes les options
Par contre, pour ouvrir directement le fichier *.pdf, tu peux utiliser ce code de Daniel Josserand (daniel.j) :
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal lpszDir As String, ByVal fsShowCmd As Long) _
As Long
Const SW_SHOWNORMAL = 1
Sub Test()
Select Case [A2]
Case "client entreprise"
Select Case [B2]
Case "OUF (2h)"
fichier = "R:\Projet\GSF_FACO\Public\02 Projets\02 Documents\2008-PM02\18-AG2O - Simplification paramétrage prix des options - Hors IPP\40 - TRA\90-Divers\Factures PDF PM06 2007.pdf"
Case "UVQ (5h)"
fichier = "chemin\fichier.pdf"
End Select
Case "client PGP"
Select Case [B2]
Case "OUF (2h)"
fichier = "chemin\fichier.pdf"
Case "UVQ (5h)"
fichier = "chemin\fichier.pdf"
End Select
End Select
StartDoc (fichier)
End Sub
Public Sub StartDoc(ByVal szDoc As String)
Dim lRet As Long
lRet = ShellExecute(0, "Open", szDoc, "", "C:\", SW_SHOWNORMAL)
End Sub
Edit : j'oubliais...
dans le code de ton bouton, tu mets :
Private Sub CommandButton1_Click()
Call Test
End Sub