Bonjour la communauté.

Je cherche comment à partir d'un bouton, ouvrir un fichier.mht.
J'ai effectué des recherches et mon code ne marche pas.

Pour informations, le nom du fichier recherche l'année dans une cellule et le N° dans une autre.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
Private Sub CommandButton4_Click()
 
Dim oFSO As Scripting.FileSystemObject
Dim oTxt As Scripting.TextStream
'Instanciation du FSO
Set oFSO = New Scripting.FileSystemObject
 
Set oTxt = oFSO.OpenTextFile("C:\Suivi_DLC\Archives_" & Range("C167").Value & "\Batch_BL_N°" & Range("D1677").Value & "\Docsuivicharge.mht", ForReading)
End Sub
Merci par avance