Monday, April 9, 2018

errors in vba


Errors in vba
Syntax errors
Syntax errors, also called as parsing errors, occur at the interpretation time for VBScript. For example, the following line causes a syntax error because it is missing a closing parenthesis

Function error_handling_demo()
Dim x,y
X=”janusapps”
Y=ucase(x
End function

Run time errors
Runtime errors, also called exceptions, occur during execution, after interpretation.
For example, the following line causes a runtime error because here the syntax is correct but at runtime it is trying to call fnmultiply, which is a non-existing function.

Function run_time_error()
Dim x,y
X=5
Y=10
Z=fnmutiply(x,y)
End function

Logical errors
Logical errors can be the most difficult type of errors to track down. These errors are not the result of a syntax or runtime error. Instead, they occur when you make a mistake in the logic that drives your script and you do not get the result you expected.



No comments:

Post a Comment

Data base function

Database function Daverage function      Averages the values in a field (column) of records in a list or database that match conditio...