Invalid procedure call caused by if with empty strings

0 Likes

Problem:

CodeReview 6.X - Error: 5 Invalid procedure call or argument when running a review

Resolution:

This is a known issue with CodeReview 6.5. It does not handle the use of an empty string in a complex condition of a decision or loop statement. In order for CodeReview to analyze this code, we recommend either changing the "" to vbNullString or checking for a zero length string.

For example, instead of

If string1 = "" And string2 = "" And string3 = "" Then

you use

If string1 = vbNullString And string2 = vbNullString and string3 = vbNullString Then

or

If Len(string1) = 0 And Len(string2) = 0 And Len(string3) = 0 Then

Old KB# 12275
Comment List
Anonymous
Related Discussions
Recommended