[2092]More incorrect VB code analysis
Found the following:
The variable templateName is definetly used in the next statement. Another sample for this:
The variable xlRange is used outside the if-block. On the other hand R# didn't recognize that the last case label is not used.
Another problem i've found was this:
In this case the VB compiler don't flag an error and correctly calls the Sub Activate(). I'm not sure if VB is too lazy here.
Regards
Klaus
Please sign in to leave a comment.
Problem 1: thank you for report, it will be fixed shortly Problem 2: Not a problem! The assigned "xlRange" is immediately overwritten after Select block Problem 3: Please could you create small sample solution demonstrating this problem? Thank you in advance
Hi Eugene,
for Problem 3 i just added a line to the sample i sent you a few days before. Just found another problem with analyzing COM-Objects. There is a call to an Excel-Function with named parameters in my application and R# flags them as unknown. I have added a line in the sample too. It seems that R# has problems when function return values are of type Object.
Problem 2 is definetly a error in the code. I have refactored a similar piece some times ago and forgotten to copy the code to this place. Thanks for putting my attention on this :)
Regards
Klaus
Attachment(s):
ExcelCom.zip
Just found another problem with XML comments. I have declared an Event and put a comment on it. In the param-tag R# says "Cannot resolve symbol". I have updated my sample solution to demonstrate the problem (See Class1).
Regards
Klaus
Attachment(s):
ExcelCom.zip
All problems in this sample are fixed, except for the "Activate" method call. Here VB compiler behavior differs from VB specification, and this requires extra investigations.
thanks for the feedback, hope a new EAP build will be published soon because the red error marks in the source always irritating me.