I had this:
using Excel = Microsoft.Office.Interop.Excel;
. . .
private Excel.Application _xlApp;
private Excel.Workbook _xlBook;
private Excel.Sheets _xlSheets;
private Excel.Worksheet _xlSheet;
CodeRush said the "Excel." for _xlBook, _xlSheets, and _xlSheet (but not _xlApp) was superfluous ("Redundant type qualifier"), so I removed them:
private Excel.Application _xlApp;
private Workbook _xlBook;
private Sheets _xlSheets;
private Worksheet _xlSheet;
Then, though, on trying to compile, I got err msgs like:
The type or namespace name 'Sheets' could not be found (are you missing a using directive or an assembly reference?)
So following CodeRush's recommendation broke the build (it was easy to revert back, of course, to a compiling state), but more interesting to me is why it didn't also recommend I remove the "Excel." from "Excel.Application _xlApp"
Why does it recognize that the "Excel." prefix is needed for Application, but not for Workbook, Sheets, and Worksheet?
UPDATE
FWIW, other recommended changes by CodeRush also broke my build (noted below); additionally, it added acres of blank spaces to various places in my code when I ran "Code Cleanup" or some such command. I have uninstalled CodeRush. For my money, Resharper is a clear and decisive prevailer when comparing the two tools.
Another instance (no pun intended) where CodeRush didn't realize when a namespace needed a prefix was with this:
namespace RoboReporter.DeliveryPerformance
{
public class DeliveryPerformance
...it advised removal of "RoboReporter." like so:
namespace DeliveryPerformance
{
public class DeliveryPerformance
...but when I did that it thought that a reference to DeliveryPerformance (specifically, "List<DeliveryPerformance>") was pointing, not to the class, but to the namespace.