Your code uses the CDec function, which causes an error when the system sets the Comma character as the decimal separator. In this case, you must replace the period with a comma before using the function. The Val function doesn't require this because it uses a period as the decimal separator. However, the Val function only supports a limited number of 14 decimal digits.
Your code uses the
CDecfunction, which causes an error when the system sets the Comma character as the decimal separator. In this case, you must replace the period with a comma before using the function. TheValfunction doesn't require this because it uses a period as the decimal separator. However, theValfunction only supports a limited number of 14 decimal digits.