Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectVariableNotSetInspection ignores default member accesses. #2602

Closed
comintern opened this issue Jan 31, 2017 · 0 comments
Closed

ObjectVariableNotSetInspection ignores default member accesses. #2602

comintern opened this issue Jan 31, 2017 · 0 comments
Labels
bug Identifies work items for known bugs feature-inspections

Comments

@comintern
Copy link
Contributor

Second issue with the same code as #2601:

In a UserForm with TextBox1 :

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    If TextBox1.Text = vbNullString Then
        MsgBox "Value required"
        Cancel = True
    End If
End Sub

The Cancel = True line triggers the ObjectVariableNotSetInspection (twice, but that's likely a different issue...). In this case, Set isn't required because the RHS of the assignment is a value type and the LHS is a reference type.

Also related: #2504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs feature-inspections
Projects
None yet
Development

No branches or pull requests

2 participants