By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,776 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,776 IT Pros & Developers. It's quick & easy.

Error handling code not working on my laptop

P: 4
Hi everyone out there
I have a rather funny problem.
Error handling code routines do not seem to work on my laptop.
I still get the default error messages when i test.
One my desktop the code works just fine and i get the custom error messages
Actually i have tried five examples which are working on my desktop but not on my laptop. I tried fix and repair office but the problem still persists
thanks


here is an example:
-----------------------------------------------------------------------------------------------------------
Private Sub cmdAdd_Click()
On Error GoTo ErrorHandler

Dim x As Double
Dim y As Double
Dim z As Double

x = Me.txtFirst.Value
y = Me.txtSecond.Value
z = (Me.txtFirst.Value) + (Me.txtSecond.Value)

Me.txtResult.Value = z


CleanUpAndExit:
Exit Sub

ErrorHandler:
MsgBox "Numeric values please!!"
Resume CleanUpAndExit

End Sub
-----------------------------------------------------------------------------------------------------------
May 13 '07 #1
Share this Question
Share on Google+
3 Replies


JConsulting
Expert 100+
P: 603
Hi everyone out there
I have a rather funny problem.
Error handling code routines do not seem to work on my laptop.
I still get the default error messages when i test.
One my desktop the code works just fine and i get the custom error messages
Actually i have tried five examples which are working on my desktop but not on my laptop. I tried fix and repair office but the problem still persists
thanks


here is an example:
-----------------------------------------------------------------------------------------------------------
Private Sub cmdAdd_Click()
On Error GoTo ErrorHandler

Dim x As Double
Dim y As Double
Dim z As Double

x = Me.txtFirst.Value
y = Me.txtSecond.Value
z = (Me.txtFirst.Value) + (Me.txtSecond.Value)

Me.txtResult.Value = z


CleanUpAndExit:
Exit Sub

ErrorHandler:
MsgBox "Numeric values please!!"
Resume CleanUpAndExit

End Sub
-----------------------------------------------------------------------------------------------------------
Go into your VBA Tools/Options/General tab

Check the box settings there. Set to Break on unhandled errors.

J
May 13 '07 #2

P: 4
Go into your VBA Tools/Options/General tab

Check the box settings there. Set to Break on unhandled errors.

J

thanks a million
May 13 '07 #3

JConsulting
Expert 100+
P: 603
thanks a million
Anytime
J
May 13 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.