Visual basic run-time error 6 (overflow) when running script

58 views Asked by At

Got a mega weird task in college. We are learning Visual Basic in our first year. I am a newbie, I need to output the result of variable y in a TextBox, but I am getting error 6 runtime error (overflow). Please correct the code, what did I do wrong? enter image description here

Private Sub CommandButton1_Click()

x = 2.5
b = 7

a = b ^ 3 + Log(Abs(b))
c = a ^ 2 + Sqr(b)
y = Exp(1) ^ x + 5.8 ^ c


TextBox3.Text = y


End Sub

enter image description here

0

There are 0 answers