I made an application in C # and to integrate with Spring ERP and I passed the engine in VBA through the following line.
void IPublicMethods.UpdateCDU_IfItemSelected(ref dynamic doc, string artigo, int numLinha, ref dynamic plataformaPri, ref dynamic BSO)
{
//Variable to tell if a document must set the CDUs for MoedaRef
bool usaMoedaRef = false;
try
{
//Get the value from DocumentosVanda table that tell if the current document must set the CDUs for MoedaRef
plataformaPri.Dialogos.MostraAviso("Chegei!", Enums.PRI_Informativo, $"Cheguei antes do erro.");
usaMoedaRef = BSO.Comercial.TabVendas.DaValorAtributo(doc.Tipodoc, "CDU_UsaMoedaRef");
}
catch (Exception ex)
{
plataformaPri.Dialogos.MostraAviso("Erro!", Enums.PRI_Informativo, $"Ocorreu um erro ao calcular os preços {ex.Message}.");
}
}
And VBA is like this
OpsMoedaRef.updateCDU_IfItemSelected Me.DocumentoVenda, artigo, numLinha, PlataformaPRIMAVERA, BSO