Today a new build 22.214.171.124 of MZ-Tools has been released with some bug fixes and several important enhancements thanks to your feedback, including a feature of MZ-Tools 3.0 that was not available yet on MZ-Tools 8.0: the ability to save files at debug-time (with a keyboard shortcut). New File/Method properties such as CodeLineCount, CommentLineCount, BlankLineCount, etc. (and the equivalent ones as percentages) have been added to the programming rules review, so that you now can create rules of the type “If you create spaghetti code, at least comment it profusely” :-). If you are a VBA user, toolwindows such as the Code Explorer now refresh automatically when the active window changes. The Insert Header is now more usable: there is a new menu entry on the context menu of the code window, and to insert a header to a file you can now put the cursor at any column of line 1 (not at column 1 as before). Also, the headers can use now two new predefined variables to define a section for the return value of a method or property. The whole section is deleted if the method doesn’t return a value, so you can define a unified header for Sub and Function methods. Finally, this build introduces a more streamlined experience in the Check for Updates feature requiring fewer clicks to update (you will notice this in the next monthly build).
The complete changelog is the following:
- New (VB6/VB5): Keyboard shortcut to save file at debug-time (this feature was in MZ-Tools 3.0).
- Enhanced [#11944] (All): Added the following properties to the Programming Rules Review: LineCount (formerly CodeLineCount, which changes the meaning), CommentLineCount, BlankLineCount, CodeLinePercentage, CommentLinePercentage, BlankLinePercentage.
- Enhanced [#11910] (All): The check for updates process requires now fewer clicks to install the latest version.
- Enhanced [#11924] (All): The context menu of the code window now provides the “Insert Header” meny entry.
- Enhanced [#11857] (VBA): Toolwindows (Code Explorer, TabIndex Assistant, etc.) are now refreshed automatically when the active window changes.
- Enhanced [#11924] (VB/VBA): The Insert Header feature now allows the cursor on any column of line 1 when inserting a class or module header.
- Enhanced [#11946] (All): Added predefines variables “Method Return Section Begin” and “Method Return Section End” to exclude information about the return type in headers for methods that don’t return a value (“void” in C#, “Sub” in VB, etc.).
- Enhanced [Internal] (VBA): The portable edition provides the option to isolate or not MZ-Tools, and the Com Shim provides better diagnostics.
- Fixed [#11957] (VBA): The scope “Open files” didn’t work if the filename contained the “-” character.
- Fixed [#11902] (All): In the dialog to enter the values of user-defined variables, if the value of a user variable was long enough to show the horizontal scrollbar in the preview richtextbox, the textbox with the value lost the focus.
- Fixed [#11920] (All): NullReferenceException could happen in some circumstances.
- Fixed [#11899] (VB/VBA): The Initialize and Terminate methods of classes were not shown in Code Explorer, and no icon was shown for them in the results window. This bug was introduced in build 126.96.36.199.
- Fixed [#11903] (VB/VBA): Some features such as the Line Indenter caused error with comments that included again the comment character. This bug was introduced in build 188.8.131.52.
- Fixed [#11958] (VB/VBA): The Insert Error Handler and other features don’t work correctly if the method declaration contains optional parameters initialized with dates or quotes that include the ‘:’ character.
- Fixed [#11901] (VS): The Results window didn’t locate correctly variables declared with the same name in different blocks of the same method.
- Fixed [Internal] (VB5/VB6): The main toolbar didn’t show all the buttons when using a resolution of 1280 horizontal pixels due to the new Code Explorer button. Now the Collapse Projects button has been moved to the Other Utilities toolbar. This bug was introduced in build 184.108.40.206.
- Fixed [#11947, #11954] (VB/VBA): The Code Explorer could cause System.Runtime.InteropServices.COMException (0x80020010): Invalid callee. (Exception from HRESULT: 0x80020010 (DISP_E_BADCALLEE)).
Today a new build 220.127.116.11 of MZ-Tools has been released with some bug fixes and interesting enhancements:
The Programming Rules Review now shows all violations of rules that use the “Not Containing” and “Not Matching” operators. So, for example, if you don’t want to use the Static modifier in procedure variables, now you get all the occurrences, not only the first one:
More importantly, the Programming Rules Review now allows to define a programming rule that is quite requested: if the code of a method (or module) contains some expression, then the code of that method (or module) must contain also some other expression. For example, if a method opens a recordset, it must close that recordset (or set a variable to Nothing). How this is done will be the subject of a separate post.
For VB/VBA, the Code Explorer and other features now distinguish between procedures that are subroutines (Sub) and procedures that are functions (Function). Notice the new icons and the separate filters:
The Options dialog now uses a more modern dialog to select a folder, that allows you to type (or paste) the full path to the folder:
The complete changelog is the following:
- Enhanced [#11869] (All): The Programming Rules Review now allows regular expressions backreferences in the Value field of a condition for captures in the value field of a When condition.
- Enhanced [Internal] (All): The Programming Rules Review now shows all violations using the “Not Containing” and “Not Matching” operators.
- Enhanced [#11837] (All): On Windows Vista or higher you can now type the location of the options files, with a new folder browser dialog.
- Enhanced [#11874] (VB/VBA): Features that deal with procedures now distinguish between Subs and Functions.
- Fixed [#11886] (All): The Private Clipboards dialog now allows to click the OK button by keyboard using Alt+O.
- Fixed [#11863] (All): The Find Text feature didn’t allow regular expressions when using Multiline.
- Fixed [#11883] (VB/VBA): The Statistics feature now includes only text files that are recognized text files or parents of code files.
- Fixed [#11880] (VB/VBA): Event handlers were considered dead code if used all lower case.
- Fixed [#11866] (VBA): The Insert Header feature can cause NullReferenceException when used with CSS files (which are unsupported).
- Fixed [#11845] (VBA): The Line Indenter didn’t parse correctly lines with the space + comment character sequence inside a string.
- Fixed [#11825] (VBA): After inserting a code template, the code window didn’t get the focus.
- Fixed [#11837] (VBA): On Windows Vista or higher you can now type the location of the options files, with a new folder browser dialog.
- Fixed [#11858] (VBA): The Database Connection Assistant didn’t show the connection string with the MySQL ODBC driver.
- Fixed [#11894] (VBA): The scope “Open files” didn’t work in Microsoft Access.
- Fixed [Internal] (All): The Programming Rules Review caused exceptions if invalid regular expressions were used.
Last January 1 another monthly build was released, 18.104.22.168. This time, apart from some bug fixes, it introduces a new feature: a file code explorer:
You can read more about the Code Explorer on this post: Moving from MZ-Tools 3.0 to 8.0 Part 32: A Code Explorer.
Also, support for drag & drop in the TabIndex Assistant is reintroduced (this was supported in MZ-Tools 3.0, but not in MZ-Tools 8.0 until now).
The complete changelog is the following:
MZ-Tools 22.214.171.124 released (January 1, 2017)
- New (VB/VBA): Code Explorer.
- Enhanced [#11723] (All): Added support for drag & drop in TabIndex Assistant, Switch Assistant and other listviews.
- Fixed [#11779] (All): The Programming Rules Review didn’t locate results using regular expressions when the found text ended with carriage return without line feed.
- Fixed [#11775] (All): The Code Element Headers Review caused “Unterminated  set” with headers that included parameters of array types.
- Fixed [#11750] (All): The Generate HTML documentation could cause System.Xml.XmlException: hexadecimal value is an invalid character.
- Fixed [#11739, #11749, #11757] (VB/VBA): The language of the user interface was always English on Windows 7. This bug was introduced in build 126.96.36.199.
- Fixed [#11766] (VS): The New Method/Property Assistant added quotes to the initial value String.Empty.
- Fixed [#11804] (VBA): The Find feature could cause System.ArgumentOutOfRangeException when using the VBA editor with double-byte encondings.
- Fixed [Internal] (VB): The Generate Documentation (XML/HTML) could cause System.NullReferenceException (“System Error &H80004003. Invalid pointer”) if the operation was executed twice.
- Fixed [Internal] (VBA): The width of buttons on toolbars was not correct when using high-DPI displays.
The build 188.8.131.52 released on January 1, 2017, introduces another very requested feature: a Code Explorer. This feature provides you a list with all the code elements of the active code window:
The Code Explorer shows the code elements of the following kinds:
- User-Defined Types
On the toolbar there are seven toggle buttons to show/hide the code elements of a particular kind. Here you can see the Code Explorer showing only fields:
Furthermore, to the right of the toolbar you have a textbox to enter any text, so that only the code elements containing that text are shown:
And selecting any code element in the list shows it in the code window. I hope that you find this tool productive to locate your code faster!
The past November 16 a new build 184.108.40.206 was released with some bug fixes and, more importantly, with support for the Visual Studio 2017 Release Candidate 1 announced by Microsoft at the Connect(); 2016 event.
Today a new build 220.127.116.11 has been released with new bug fixes, one of them specially important if you are using Visual Basic 6.0 since the Rename Related Source Code feature was crashing usercontrols.
Also, this month the MZ-Tools website started to use https and this caused a problem in the Check for Updates feature that is now fixed.
The changelogs are the following:
MZ-Tools 18.104.22.168 released (November 16, 2016)
- New (VS): Added support for VS 2017 RC.
- Fixed [#11691] (All): The Generate HTML Output Documentation removed indentation of comments in headers.
- Fixed [#11662] (All): The Dead Code Review didn’t parse correctly statements that were not Dim declarations in lines that started with Dim declarations.
- Fixed [#11670] (VB/VBA): The Replace feature could cause System.ArgumentOutOfRangeException “Index and length must refer to a location within the string” could happen in some cases.
- Fixed [#11666] (VBA): LongLong and LongPtr types were not recognized.
- Fixed [#11695] (VBA): The TabIndex Assistant and other features duplicated a control if the parent was a Frame control inside another Frame control.
MZ-Tools 22.214.171.124 released (December 1, 2016)
- Fixed [#11715] (All): The Check for updates feature caused “http://www.mztools.com/v8/latestversion.txt” not found because of https.
- Fixed [#11716] (All): The Review Code Element Headers could cause System.ArgumentNullException “Value cannot be null”.
- Fixed [#11724] (All): MZ-Tools entry is no longer created in Control Panel > Programs and features if silent switches are used for automated deployments.
- Fixed [#11703, #11704] (VB6): Custom control crashed when renamed if the “Rename Related Source Code” feature was activated.
Today a new build 126.96.36.199 has been released, as every month, with some bug fixes. Now I am working on compatibility with VS “15”.
The complete changelog is the following:
MZ-Tools 188.8.131.52 released (November 1, 2016)
- Fixed [#11589] (All): The Code Library and other tree-based lists were not sorted ignoring case.
- Fixed [#11613] (All): The Review Headers did not skip DllImport / Declare methods.
- Fixed [#11638] (VS): System.NotImplementedException “The method or operation is not implemented.” could happen when using SQL Server Database Projects that reference databases.
- Fixed [#11601] (VB/VBA): The Ctrl+F keyboard shortcut was not allowed to be assigned to the Find Text feature of MZ-Tools to override the Find feature of VB/VBA.
- Fixed [#11624] (VB/VBA): The New Property Assistant showed an empty list for headers if both Get/Let-Set radiobuttons were selected.
- Fixed [#11623] (VB/VBA): The Review Dead Code didn’t ignore parameters of callbacks of Ribbon code.
- Fixed [#11643] (VB5/VB6): The Find text window and the Results window did not work correctly at debug or run-time.
- Fixed [#11592] (VBA): “System.InvalidCastException: Unable to cast COM object of type ‘System.__ComObject’ to class type ‘System.Windows.Forms.UserControl'” happened if an old version was installed with admin rights and a newer version was installed without admin rights and without uninstalling the previous version.
MZ-Tools 8.0 for VBA, released a year ago, already introduced an innovation in the world of add-ins for the VBA editor allowing to install it without admin rights, something that was quite requested because in many companies users of Office are not admin users (and that’s right).
The build 184.108.40.206 released yesterday, in the first anniversary, introduces yet another innovation in this area: a portable edition. That’s right, you can now run MZ-Tools 8.0 for VBA without running a setup. You can even run it from a USB drive if you want, without copying any file to the hard disk of your computer. This scenario is not so much requested, but it seems that there are companies where users are not allowed (by group policies) to run any kind of setup (even those setups that don’t require admin rights), and maybe even PowerShell or regedit.exe are not allowed either.
So, a portable edition is now provided. The setup edition is still not only provided but also recommended (at least for now). The portable edition is suitable for the scenarios mentioned above.
When you download the portable edition, you get a MZTools8VBAPortable.zip file that, when unzipped, has this file structure:
There is a MZTools8VBAPortable.exe executable (with a .config file to allow it to run on whatever .NET Framework you have installed, 2.0 or 4.0) and a Files folder, that contains the files (dlls) and the options files (although you can configure the options files anywhere).
When you run the MZTools8VBAPortable.exe file, you get a dialog to register MZ-Tools 8.0 for VBA in the VBA editor:
And, of course, you can unregister it if you want.
Yesterday it was the first anniversary of MZ-Tools 8.0 for VBA, VB6 and VB5. Happy birthday! I want to thank all the people whose feedback has made this product much better, requesting new features and enhancements, and reporting bugs.
Yesterday also a new build 220.127.116.11 was released, as every month. The complete changelog is the following:
MZ-Tools 18.104.22.168 released (October 1, 2016)
- New [Internal] (VBA): MZ-Tools 8.0 for VBA Portable edition.
- Fixed [#11589] (All): The Code Library doesn’t set the focus on the treeview with code templates when shown.
- Fixed [#11522, #11524] (VB6/VB5): Toolwindows could not be shown (System.InvalidCastException “Unable to cast COM object of type ‘System.__ComObject’ to class type System.Windows.Forms.UserControl”) on Windows 8 or higher if VB6/VB5 is running in compatibility mode with Windows XP. This bug was introduced in build 22.214.171.124.
- Fixed [#11580] (All): The Headers Review didn’t ignore spaces at the end of a line for VB/VB.NET languages.
- Fixed [#11589] (VB/VBA): The Esc key allows to close toolwindows.
- Fixed [#11570] (VB/VBA): The Line Indenting feature caused “System.InvalidOperationException: Indentation of paragraph of file failed” if the file ended with a line with spaces and the last method included line numbers.
- Fixed [#11544] (VBA): The Options window doesn’t show the Personal / Team options tabs on some configurations (Windows 10 on Parallels).
- Fixed [#11554] (VBA): The Generate HTML/XML documentation feature crashed the VBA editor of the GE iFix host.
- Fixed [#11589] (VBA): The Tab key didn’t navigate correctly in the Code Library.
- Fixed [Internal] (All): The dialog to download an updated version didn’t set correctly the position of a label.
- Fixed [Internal] (VBA): MZ-Tools could not be loaded in the VBA editor of Office 2000 on Windows XP with .NET Framework 2.0.
The last build 126.96.36.199 released last September 1 introduced two important bugs and a previous build 188.8.131.52 introduced two other bugs related to .NET Framework versions that could prevent the load of MZ-Tools 8.0 for VB6/VB5/VBA in some scenarios. I have considered all of them enough important to release the fixes today. I am sorry the inconveniences.
The change log is the following:
MZ-Tools 184.108.40.206 released (September 5, 2016)
- Fixed [Internal] (All): Error “Creation of tool window failed” when MZ-Tools tries to restore a toolwindow that was left open in the last session.
- Fixed [Internal] (All): The Quality Review was executed on build (Release configuration) even if no review was set to execute.
- Fixed [#11477] (VB6/VB5/VBA): MZ-Tools could not be loaded on Windows XP, Windows Vista or Windows 7 without SP1 if .NET Framework 4.0 was not installed. This bug was introduced in build 220.127.116.11.
- Fixed [#11462] (VB6/VB5/VBA): Toolwindows could not be shown (System.InvalidCastException “Unable to cast COM object of type ‘System.__ComObject’ to class type System.Windows.Forms.UserControl”) on Windows 8 or higher if .NET Framework 3.5 was installed after installing MZ-Tools. This bug was introduced in build 18.104.22.168.
Yesterday MZ-Tools 22.214.171.124 was released. It introduces some new features and enhancements:
- The code elements (methods, etc.) can be sorted now manually, in addition to the automatic sorting of previous versions. This was quite requested since MZ-Tools 3.0 provided the Sort Procedures feature that allowed manual sorting.
- Several features can be now automated from a script (VBScript, PowerShell, etc.). For example, you can add line numbers or execute the quality review or statistics from a script that performs the build. This capability will be documented with samples in the next weeks. If you are already interested, contact me.
- The TabIndex Assistant is now multiselection, along with other lists. They don’t support drag & drop yet, but it’s on the roadmap.
The complete changelog is the following:
MZ-Tools 126.96.36.199 released (September 1, 2016)
- New [Internal] (All): Manual sorting of code elements (methods, etc.).
- Enhanced [#11415] (All): The Quality Review, Line Numbering and other operations can be now automated.
- Enhanced [#11431] (All): The contents of listviews/treeviews of the Options window can now be copied to the clipboard with Ctrl+C.
- Enhanced [#10456, #10369] (All): The TabIndex Assistant is now multiselection.
- Enhanced [Internal] (All): The Switch Assistant is now multiselection.
- Enhanced [Internal] (All): The Collection editor is now multiselection.
- Fixed [#11399] (All): The first used toolwindow took longer to load than the next used toolwindows.
- Fixed [#11445] (All): Result toolwindows already visible were not activated after an operation.
- Fixed [#11426] (All): The Programming Rules Review didn’t locate correctly results for code elements using operators that find forbidden text (“Not Starting With”, “Not Containing”, “Not Ending With”, “Not Matching”).
- Fixed [#11473] (All): The Nomenclature Rules editor didn’t preselect the item to review for a new item based on the existing selected item.
- Fixed [#11403] (VS): ObjectDisposedException happened when removing the Previous/Next Item in Last Window buttons on the main toolbar and prevented Visual Studio from exiting.
- Fixed [#11463] (VB/VBA): The Find feature did not find correctly carriage returns “\r\n” when using regular expressions.
- Fixed [#11386] (VB/VBA): Several features didn’t work well with duplicated procedures (which are illegal).
- Fixed [#11406] (VB/VBA): The Line Indenter didn’t parse correctly End Select statements in the same line than Case or Select Case statements.
- Fixed [#11420] (VB/VBA): The New Method/Property Assistant didn’t use the terms “Function” and “Subroutine” in the user interface.
- Fixed [#11456] (VB/VBA): The Find feature didn’t find multilines that included the ‘?’ or ‘#’ characters.
- Fixed [#11466] (VB/VBA): The Method Callers feature also returned other methods starting with the same name.
- Fixed [#11415] (VBA): The Review Quality feature prompted to compile the VBA project, which is not supported.
- Fixed [#11427] (VBA): Any file with “Report” in the name was considered a report file.
- Fixed [Internal] (All): The context menu of some features (such as Code Library) showed a separator before the first item.
- Fixed [Internal] (VB/VBA): The Find Text feature didn’t work correctly with the Match Whole Word setting when the searched string did not start or end with word characters.
- Fixed [Internal] (VB/VBA): The Line Indenter opened the code windows to perform the operation.
- Fixed [Internal] (VB/VBA): The Line Indenter didn’t parse correctly Next statements with the variable in same cases.
- Fixed [Internal] (VBA): Several operations saved the VBA project after each file was processed if the setting “Keep modified documents open” was unchecked, causing a bad performance for projects with a large number of files.