VBA Error Types:
There are three types of VBA error that you may encounter when executing an Excel macro. These are:
Compile Errors/Syntax errors: Compile Errors are recognized by the VBA compiler as being illegal and therefore, are highlighted as errors before your macro even starts to run. Syntax errors, also called as parsing errors, occur at the interpretation time for VBScript.
Runtime Errors: Runtime errors occur during the execution of your code, and cause the code to stop running. This type of VBA error is also usually relatively easy to fix, as you will be given details of the nature of the error, and shown the location where the code has stopped running also called exceptions, occur during execution, after interpretation.
Logical Errors ('bugs'): Logical Errors, otherwise known as 'bugs', occur during the execution of the VBA code, and allow the code to continue to run to completion. However, the 'bug' may cause the macro to perform unexpected actions or return an incorrect result. These errors are the most difficult to detect and fix, as there is no way that the VBA compiler can identify and 'point to' the error, in the way that it does for compile and runtime errors.