- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I created an ilogic external rule that uses GoExcel.
The rule works on my workstation and on my personnal computeur but bug on the PCs of my colleagues. The error I get varies:
Error1:
Impossible d'effectuer un cast d'un objet COM de type 'Microsoft.Office.Interop.Excel.ApplicationClass' en type d'interface 'Microsoft.Office.Interop.Excel._Application'. Cette opération a échoué, car l'appel QueryInterface sur le composant COM pour l'interface avec l'IID '{000208D5-0000-0000-C000-000000000046}' a échoué en raison de l'erreur suivante : Élément introuvable. (Exception de HRESULT : 0x8002802B (TYPE_E_ELEMENTNOTFOUND)).
Error2:
Cannot find the column header "TypeProfil" (The column does exist in Excel (standard cell format))
Would you know why?
We use differents versions of office.
The rules works on personnal and familly office 2019 and also on Microsoft Office 365.
The rules don't works on Microsoft Office 365 busines...
Thanks in advance for your time.
The rule is below.
The error start on line "Ligne1 = GoExcel.FindRow(oExcelPath, "Index", "TypeProfil", "=", Parameter("TypeDeProfil"))"
oExcelPath= "C:\VaultWorkspace\Designs\Fichiers Matières ERP\ListeCDC.xlsx" 'Determine l'onglet dans lequel on doit cherché la Matière automatique Ligne1 = GoExcel.FindRow(oExcelPath, "Index", "TypeProfil", "=", Parameter("TypeDeProfil")) Onglet1 = GoExcel.CurrentRowValue("NomOnglet") Select Case Parameter("TypeDeProfil") 'CAS1--------------------------- Case "Plat" 'MessageBox.Show(iProperties.Material, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Largeur", "=", Parameter("Para_A"),"Epaisseur", "=", Parameter("Para_B"),"MatièreInventor", "=", iProperties.Material) 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = -1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Plat "&Parameter("Para_A") & "x" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "F" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Plat "&Parameter("Para_A") & "x" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'CAS2--------------------------- Case "Rond" 'MessageBox.Show(iProperties.Material, "c'est du rond") 'Cherche une combinaison de Dimension et matière dans le fichier excel 'TEST ligne ci dessous masqué i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Diamètre", "=", Parameter("Para_A"),"MatièreInventor", "=", iProperties.Material) 'A = GoExcel.CellValue(oExcelPath, Onglet1, "A2") 'B = GoExcel.CellValue(oExcelPath, Onglet1, "C2") 'C = GoExcel.CellValue(oExcelPath, Onglet1, "B2") 'MessageBox.Show(A, "Lecture diametre") 'MessageBox.Show(B, "Matière") 'MessageBox.Show(C, "Matière") 'MessageBox.Show(iProperties.Material, "Matière") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then 'MessageBox.Show(iProperties.Material, "c'est du rond manuel") 'Dim MonMot As String 'MonMot = "La section " & Parameter("Para_A") & "x" &Parameter("Para_B")& " en " & iProperties.Material & " n'est pas dans base de données. La matière ERP est de type MMxxxxx" i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = -1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Rond Ø"&Parameter("Para_A") & " L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else 'MessageBox.Show(iProperties.Material, "c'est du rond auto") MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Rond Ø"&Parameter("Para_A") & " L="&Parameter("Para_L")&"mm" End If 'CAS3--------------------------- Case "Ebauche" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "De", "=", Parameter("Para_A"), "Di", "=", Parameter("Para_B"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Ø"&Parameter("Para_A") & "/Ø" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "E" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Ø"&Parameter("Para_A") & "/Ø" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'CAS4--------------------------- Case "Cornière LAC à ailes égales (Din)" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Largeur", "=", Parameter("Para_A"), "Epaisseur", "=", Parameter("Para_B"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Cornière LAC "&Parameter("Para_A") & "x"&Parameter("Para_A") & " Ep" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "F" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Cornière LAC "&Parameter("Para_A") & "x"&Parameter("Para_A") & " Ep" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'CAS5--------------------------- Case "Cornière LAC à ailes inégales (Din)" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Largeur1", "=", Parameter("Para_A"),"Largeur2", "=", Parameter("Para_B"), "Epaisseur", "=", Parameter("Para_C"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Cornière LAC "&Parameter("Para_A") & "x"&Parameter("Para_B") & " Ep" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "F" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Cornière LAC "&Parameter("Para_A") & "x"&Parameter("Para_B") & " Ep" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'CAS 6--------------------------- Case "Cornière LAC à ailes inégales (Iso)" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Largeur1", "=", Parameter("Para_A"),"Largeur2", "=", Parameter("Para_B"), "Epaisseur", "=", Parameter("Para_C"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Cornière LAC "&Parameter("Para_A") & "x"&Parameter("Para_B") & " Ep" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "F" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Cornière LAC "&Parameter("Para_A") & "x"&Parameter("Para_B") & " Ep" &Parameter("Para_B")& " L="&Parameter("Para_L")&"mm" End If 'CAS 7--------------------------- Case "UPE" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="UPE "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="UPE "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'CAS 8--------------------------- Case "UPN" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="UPN "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="UPN "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'CAS 9--------------------------- Case "U plié à froid" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Largeur", "=", Parameter("Para_A"),"Hauteur", "=", Parameter("Para_B"),"Epaisseur", "=", Parameter("Para_C"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="U à froid "&Parameter("Para_B") &"x"&Parameter("Para_A")&"x"&Parameter("Para_B")&" Ep"&Parameter("Para_C")&" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "F" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="U à froid "&Parameter("Para_B") &"x"&Parameter("Para_A")&"x"&Parameter("Para_B")&" Ep"&Parameter("Para_C")&" L="&Parameter("Para_L")&"mm" End If 'CAS 10--------------------------- Case "Tube Carré" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"),"Epaisseur", "=", Parameter("Para_B"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Tube "&Parameter("Para_A") &"x"&Parameter("Para_A")&" Ep"&Parameter("Para_B")&" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "F" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Tube "&Parameter("Para_A") &"x"&Parameter("Para_A")&" Ep"&Parameter("Para_B")&" L="&Parameter("Para_L")&"mm" End If 'CAS 11--------------------------- Case "Tube Rectangulaire" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"),"Largeur", "=", Parameter("Para_B"),"Epaisseur", "=", Parameter("Para_C"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Tube "&Parameter("Para_A") &"x"&Parameter("Para_B")&" Ep"&Parameter("Para_C")&" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "E" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Tube "&Parameter("Para_A") &"x"&Parameter("Para_B")&" Ep"&Parameter("Para_C")&" L="&Parameter("Para_L")&"mm" End If 'CAS 12--------------------------- Case "Equerre Alu" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show("Cas 12 Equerre Alu", "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'MessageBox.Show(Parameter("tempA") , "Title") i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Largeur1", "=", Parameter("Para_A"),"Largeur2", "=", Parameter("Para_B"),"Epaisseur", "=", Parameter("Para_C"), "MatièreInventor", "=", iProperties.Material) 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Equerre "&Parameter("Para_A") &"x"&Parameter("Para_B")&" Ep"&Parameter("Para_C")&" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "F" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="Equerre "&Parameter("Para_A") &"x"&Parameter("Para_B")&" Ep"&Parameter("Para_C")&" L="&Parameter("Para_L")&"mm" End If 'CAS 13--------------------------- Case "U en alu" 'MessageBox.Show("Cas 13 U en Alu", "Para_A") 'MessageBox.Show(Onglet1, "Para_A") i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"),"Largeur", "=", Parameter("Para_B"),"Epaisseur", "=", Parameter("Para_C"), "MatièreInventor", "=", iProperties.Material) 'MessageBox.Show(i1, "Para_A") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="U "&Parameter("Para_B") &"x"&Parameter("Para_A")&"x"& Parameter("Para_B") &" Ep"&Parameter("Para_C")&" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "E" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="U "&Parameter("Para_B") &"x"&Parameter("Para_A")&"x"& Parameter("Para_B") &" Ep"&Parameter("Para_C")&" L="&Parameter("Para_L")&"mm" End If 'CAS 14--------------------------- Case "IPN" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="IPN "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="IPN "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'CAS 15--------------------------- Case "IPE" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="IPE "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="IPE "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'CAS 16--------------------------- Case "IPB" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="IPB "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="IPB "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'CAS 17--------------------------- Case "HEA" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="HEA "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="HEA "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'CAS 18--------------------------- Case "HEB" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="HEB "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="HEB "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'CAS 19--------------------------- Case "HEM" 'MessageBox.Show(iProperties.Material, "Para_A") 'MessageBox.Show(Onglet1, "Para_A") 'Cherche une combinaison de Dimension et matière dans le fichier excel i1 = GoExcel.FindRow(oExcelPath, Onglet1, "Hauteur", "=", Parameter("Para_A"), "MatièreInventor", "=", iProperties.Material) 'Parameter("tempA") = GoExcel.CellValue(oExcelPath, Onglet1, "A1") 'Parameter("tempB") = GoExcel.CellValue(oExcelPath, Onglet1, "B1") 'Parameter("tempMat")=GoExcel.CellValue(oExcelPath, Onglet1, "D1") 'Si on ne trouve pas la combinaison i=-1 et on utilise une matière manuelle If i1 = -1 Then i2 = GoExcel.FindRow(oExcelPath, "Matière Manuelle", "MatièreInventor", "=", iProperties.Material) If i2 = - 1 Then MessageBox.Show("Une matière d'inventor n'est pas definit dans le fichier Excel", "ERREUR") Else MatErp = GoExcel.CellValue(oExcelPath, "Matière Manuelle", "B" & i2) 'MessageBox.Show(Parameter("Para_A"), "A") iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="HEM "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If 'Si on trouve la combinaison -> on utilise une matière auto MAxxxxx Else MatErp = GoExcel.CellValue(oExcelPath, Onglet1, "D" & i1) iProperties.Value("Custom", "MatièreERP") = MatErp iProperties.Value("Custom", "LongueurERP") = Parameter("Para_L") iProperties.Value("Project", "Stock Number")="HEM "&Parameter("Para_A") &" L="&Parameter("Para_L")&"mm" End If Case Else MessageBox.Show("Rien n'a été trouvé vérifier les valeurs indiquées", "Il y a un problème") End Select
Solved! Go to Solution.