Tengo que arreglar una macro y tiene un error en la siguiente linea:
Código:
m_iNodesCount = VBA.CInt(VBA.Trim(InputB(12, #ff)))
Cuando recorro el codigo el valor que entrega el InputB(12, #ff) cambia y nose porque, pero el valor que mas se repite es VBE6.D, creo que ese es el valor...
Estoy casi seguro que el problema esta ahi, pero no entiendo bien cual es el fin de esa linea ya que yo no hice el codigo (es generado automaticamente y ademas tiene algunas modificaciones que ahi son nombradas). Por el recorrido que hice del codigo creo que esta linea, VBA.CInt(VBA.Trim(InputB(12, #ff))), debiera devolver un valor entero que es lo que no esta haciendo...
Aca les dejo un trozo de texto donde se encuentra la linea con el problema:
Código:
On Error GoTo fError
ff = FreeFile()
Open m_strDownloadDirectory + "\blue.bin" For Binary Access Read As #ff
If m_bDebugMode = True Then
Stop
End If
'erste Zeile, Anzahl Strukturelemente
m_iNodesCount = VBA.CInt(VBA.Trim(InputB(12, #ff)))
' Guardar Informacion en Matriz - Modificado por BCTS
ReDim BP_STRUC(m_iNodesCount)
'Strukturelemnte einlesen
For i = 1 To m_iNodesCount
BP_STRUC(i).NODE_ID = VBA.Trim(InputB(64, #ff))
BP_STRUC(i).NODE_TYPE = VBA.Trim(InputB(8, #ff))
BP_STRUC(i).NODE_LEVEL = VBA.Trim(InputB(4, #ff))
BP_STRUC(i).NODE_NUM = VBA.Trim(InputB(64, #ff))
If Len(BP_STRUC(i).NODE_NUM) = 3 Then ' Elimina numeros segun su nivel - Modificado por BCTS
BP_STRUC(i).NODE_NUM = Right(BP_STRUC(i).NODE_NUM, 1)
Else
If Len(BP_STRUC(i).NODE_NUM) <= 7 Then
BP_STRUC(i).NODE_NUM = Right(BP_STRUC(i).NODE_NUM, 3)
Else
BP_STRUC(i).NODE_NUM = Right(BP_STRUC(i).NODE_NUM, 5)
End If
End If
BP_STRUC(i).NODE_TEXT = VBA.Trim(InputB(152, #ff))
If BP_STRUC(i).NODE_LEVEL = "03" Then 'incorpora el texto correspondiente al nivel - Modificado por BCTS
nombre_manual = BP_STRUC(i).NODE_TEXT
BP_STRUC(i).NODE_TEXT = "Escenario de Negocio: " & BP_STRUC(i).NODE_TEXT
End If
If BP_STRUC(i).NODE_LEVEL = "05" Then
BP_STRUC(i).NODE_TEXT = "Proceso de Negocio: " & BP_STRUC(i).NODE_TEXT
End If
If BP_STRUC(i).NODE_LEVEL = "06" Then
BP_STRUC(i).NODE_TEXT = "Paso de Proceso: " & BP_STRUC(i).NODE_TEXT
End If
Next i
espero que me puedan ayudar... gracias