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

Object variable not set #383

Closed
retailcoder opened this issue Apr 16, 2015 · 1 comment
Closed

Object variable not set #383

retailcoder opened this issue Apr 16, 2015 · 1 comment
Assignees
Labels
enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections
Milestone

Comments

@retailcoder
Copy link
Member

This code compiles:

Sub DoSomething()
    Dim foo As Object
    foo = 42
End Sub

As does this code:

Sub DoSomething()
    Dim foo As MyClass
    foo = New MyClass
End Sub

And this code:

Sub DoSomething()
    Dim foo As Collection
    With foo
        .Add 42
    End With
End Sub

Both will result in runtime error 91 - object or with block variable not set, a very common VBA programming error.

As of version 1.3, Rubberduck has everything needed to detect these anomalies, and warn about them. Let's implement a code inspection for it.

@retailcoder retailcoder added this to the Version 2.0 milestone Dec 31, 2015
@retailcoder
Copy link
Member Author

This inspection needs to be implemented for 2.0.

@retailcoder retailcoder self-assigned this Apr 21, 2016
@Vogel612 Vogel612 added enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. and removed feature-request labels Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-inspections
Projects
None yet
Development

No branches or pull requests

2 participants