Codigos de VBA crashea Excel
Tengo un problema con unas líneas de código de vba que producen que Excel deje de funcionar y se cierre.
clientes.APORTEGA = Range(Ubica).Offset(0, 37).Value
clientes.MORA = Range(Ubica).Offset(0, 38).Value
clientes.APORTEBONIFICACIONESBC = Range(Ubica).Offset(0, 40).Value
clientes.APORTEBONIFICACIONESPESOS = Range(Ubica).Offset(0, 41).Value
clientes.SALDODEUDOR = (Val(PRECIOVBC.Value) + Val(PRECIOLBC.Value) + Val(SUSCRIPCIONPLAN.Value)) + ((Val(PRECIOVPESOS.Value) + Val(PRECIOLPESOS.Value) + Val(SUSCRIPCIONPLAN2.Value)) / Val(PRECIOBCFIRMA.Value)) - (Val(APORTEBC.Value) + Val(APORTEADELANTOBC.Value) + Val(APORTEBONIFICACIONESBC.Value) + Val(APORTESUSCRIPCIONBC.Value)) - ((Val(APORTEPESOS.Value) + Val(APORTEADELANTOPESOS.Value) + Val(APORTEBONIFICACIONESPESOS.Value) + Val(APORTESUSCRIPCIONPESOS.Value)) / Val(PRECIOBCFIRMA.Value))
Rem PORCENTAJES
clientes.PTPPE = Range(Ubica).Offset(0, 44).Value
clientes.Text = Format(PTPPE.Text, "0.00%")
clientes.PTPBC = Range(Ubica).Offset(0, 45).Value
PTPBC.Text = Format(PTPBC.Text, "0.00%")
clientes.PTABC = Range(Ubica).Offset(0, 46).Value
PTABC.Text = Format(PTABC.Text, "0.00%")
clientes.PTAPE = Range(Ubica).Offset(0, 47).Value
PTAPE.Text = Format(PTAPE.Text, "0.00%")
clientes.PAT = Range(Ubica).Offset(0, 48).Value
PAT.Text = Format(PAT.Text, "0.00%")
clientes.PS = Range(Ubica).Offset(0, 49).Value
PS.Text = Format(PS.Text, "0.00%")
Lo extraño de la primera parte es que ya hay otros códigos muy similares pero con otros TextBox y rango distinto que no hacen que el excel deje de funcionar.
Otro dato es que si al formulario donde esta alojado todo el código completo lo ejecuto desde vba, o sea abriendo el vbay ejecutándolo de allí, no provoca que se crashee, solo el excel deja de funcionar cuando lo ejecuto desde un botón cuando abro el libro.