Are there any FREE add-in's similar to MZTools that can quickly analyse the code for any unused variables/sub/functions etc...., add procedure/module headers, error handling?
Well until someone else replies first of all VS2008 will let you know if a variable has been declared, but not used by default. With the rest, if no-one else uses any tools and can provide advice, I'd suggest possibly looking at VS macros which you can write to automatically insert code into the code window (for the "add procedure/module headers, error handling") bit, as for the methods - I guess good old CTRL+F would help with that or a good design from the outset in order to avoid coding unessessary functionality and methods.
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
In the upper versions of VS there is Code Analysis which is very detailed and intense. I use it but as far as a replacement of mztools, not even necessary. Mztools only numbered lines (.NET IDE does that already), added boilerplate comments (.NET IDE has that too) and a few other features which are almost all relaced by the defaults in the .NET IDE.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Go into your project properties, and go to the code analysis tab.
You can enable the CODE_ANALYSIS constant here, that will cause VS to validate all these rules against your code when you build it.
Marvel at the sight of Visual Studio barfing on your code and telling you how badly you wrote it. Haha just kidding, but it does feel like that sometimes when you do use a code validation tool that is checking for "best practices" and you realized your code was far from that.
There are other tools out there like FxCop which is an MS owned free code analysis tool.
Another very popular one is refactor! which is not an MS product.
They have paid versions of it for VS2005 and 2008, however the free version I believe only works in 2008