-
Notifications
You must be signed in to change notification settings - Fork 295
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
Code Inspection - Incorrect Diagnosis: Object variable is assigned without the Set keyword #1868
Comments
Attack of the Default member. |
And another... @ThunderFrame should be new issue, or pile them all in here?
|
@Stevefb Issues should try to cover a class of problem rather than an issue for each instance. There are many, many VBA classes that have default members, so now that we know that default members remain problematic, a small number of examples is sufficient to define the problem. Having said that, the MSForms.ReturnInteger only has one member and it is the default member, so it's a good candidate for testing. |
^^^^^ Funny, originally this Sub did not actually assign a value to Cancel. RD Flagged Cancel as Unused - so I used it... |
that So these all have a single member that is also the default member:
|
Yep. But it looked better than an empty Sub... (was just showing the context as I had it in my program).... |
Oh wow. So what would be a good workaround here? Should we ignore types with a default property? or try to determine if the RHS expression is an object? |
Hmm shouldn't the "parameter not used" inspection be not firing a result for handlers of built-in events? |
One problem with default properties, at least in the Excel object model, is that what we see in the COM library is just |
In MS Word, cos ranges are different...
In this case the suggestion should have been working towards:
aRange.text = "something"
The text was updated successfully, but these errors were encountered: