i attempt to write a vba application which take data in a excel sheet, to put them in the Symbol/variable corresponding in my transmitList.
My problem is when i do that, instead of update the value of my variable, the macro create a new transmitMessage in the list, with the 0xF8 sourceAddress, with my value.
there is the code for this part:
wsExcel.Cells(indexLigne, 2) is the name of the symbol
wsExcel.Cells(indexLigne, 3) is the name of the variable
wsExcel.Cells(indexLigne, 4 + indicePasTest) is the value of the variable
Code: Select all
' pour toutes les trames de la transmit list
For Each message In appCanExplorer.Connections.TransmitMessages
' si le message est le bon nom
If message.Symbol.Name = wsExcel.Cells(indexLigne, 2) Then
For Each variable In message.multiplexer.Variables
'si la variable a le bon nom
If variable.Name = wsExcel.Cells(indexLigne, 3) Then
' on met à jour sa valeur
variable.Value = wsExcel.Cells(indexLigne, 4 + indicePasTest)
Exit For
End If
Next
End If
Next