Bonjour,
J'ai une erreur aléatoire sur le code suivant... c'est pénible !
Dim BOM As Object ' Ouverture de BOM.xls
Set BOM = GetObject(, "Excel.Application")
If Err <> O Then
Set BOM = CreateObject("Excel.Application")
End If
On Error GoTo 0
BOM.Workbooks.Open FileName:=CheminProduct & "\" & NameFichierBom
BOM.Workbooks.Application.Visible = True
Set ExcelBom = Workbooks(NameFichierBom) 'Activation Excel BOM.xls
Set ExcelBom = ActiveWorkbook
Sur cette ligne la :
Set ExcelBom = Workbooks(NameFichierBom)
J'ai l'erreur suivante :
Comment puis-je stabiliser ce code ?
Merci par avance de vos réponse !