New build MZ-Tools 8.0.0.189

It has been a while since the last update, I know. After build 8.0.0.178 (March 1) a new build 8.0.0.180 was released on April 1 that contained a change in the implementation of keyboard shortcuts for features, code templates and error handlers of VB/VBA. The Microsoft API for VB/VBA add-ins doesn’t provide support for keyboard shortcuts, so each add-in has to use some trick to provide them. For years MZ-Tools has used global hotkeys of Windows, but they have some issues (because hotkeys are global, the add-in must unregister them when the IDE is not active and re-register them when the IDE becomes active again). In build 8.0.0.180 a new more robust approach was used but it didn’t work as expected and crashes and duplicated insertions of code templates/error handlers were reported in the first day so that build was retired. Yesterday, after some months without updates, a new build has been released with the bugs reported since April.

This new build introduces also an important and somewhat breaking change if you are still using Visual Studio 2012 or 2013: MZ-Tools 8.0 for Visual Studio was provided in two ways:

  • As an “add-in” (Tools > Add-In Manager) for Visual Studio 2005, 2008 and 2010
  • As a “package” (Tools > Extensions and Updates) for Visual Studio 2012, 2013, 2015 and 2017

The functionality is roughly the same in both cases (only the installation and the Check for Updates mechanism is different).

Due to some upcoming changes in Visual Studio 2017, it’s increasingly difficult to provide the same package for Visual Studio 2012, 2013, 2015 and 2017. New Visual Studio APIs only support Visual Studio 2015 and 2017, so rather than providing a new different download for those two versions (there are already 5 download buttons on the Download page!), the add-in in build 8.0.0.189 supports not only Visual Studio 2005, 2008 and 2010 but also Visual Studio 2012 and 2013, and the package no longer support them.

This means that if you are using MZ-Tools for Visual Studio 2012 / 2013 you must:

  • Make a backup of your personal / team options, just in case, although the same location (C:\Users\<user>\AppData\Roaming\MZTools Software\MZTools8\VS) is used for the add-in and for the package.
  • Go to Tools > Extensions and Updates, Installed section, locate MZ-Tools and click the Uninstall button to uninstall the package.
  • Download the add-in setup for MZ-Tools 8.0 for Visual Studio 2005-2013 and install it.

The complete changelog is the following:

MZ-Tools 8.0.0.189 released (August 1, 2018)

  • Changed (VS 2012, 2013): MZ-Tools is now provided as an add-in for VS 2012 and 2013 rather than as a package.
  • Enhanced [#13217] (All): Added support for headers in enum items.
  • Enhanced [#13154] (VB/VBA): Added menu entries for line numbering and indenting to the context menu of the code window.
  • Enhanced [#13168] (All): MZ-Tools ensures now that toolwindows are completely inside some screen when shown.
  • Enhanced [#13144] (All): The Favorite Code Elements toolwindow no longer shows a modal messagebox when a code element is not found. Now it shows the message in a column.
  • Fixed [#12956, #12957] (VB/VBA): The mechanism for keyboard shortcuts introduced in build 8.0.0.180 didn’t work well and has been reverted.
  • Fixed [#11324, #12941] (VB/VBA): The initial indentation of MsgBox statements generared by the MsgBox Assistant was always fixed.
  • Fixed [#12964] (All): Typo in German language in the Task List.
  • Fixed [#12914] (All): MZ-Tools could hang when trying to show an exception dialog if some project reference was invalid or missing.
  • Fixed [#13202] (All): NullReferenceException could happen unloading MZ-Tools.
  • Fixed [#12914] (VB/VBA): The Method Callers feature could take a long time if a referenced type name didn’t have the correct upper/lower case.
  • Fixed [#13066] (VB/VBA): The indenter removed labels that are only numbers.
  • Fixed [#13040] (All): The Switch Assignment feature didn’t work correctly with the comment character inside quotes.
  • Fixed [#12874] (VS): The Find Text feature didn’t locate results if the end point of a result using regular expressions was between the \r and \n characters.
  • Fixed [#12873] (VB/VBA): The type of a member of a UDT was not parsed correctly if it contained a comment or the “New” keyword.
  • Fixed [#12918] (VB/VBA): Declare Sub and Declare Function were not parsed correctly if they contain comment or blank lines before the declaration.
  • Fixed [#12890] (VBA): Updating MZ-Tools from the VBA editor of Outlook caused error “Cannot start Microsoft Outlook. The command line argument is not valid. Verify the switch you are using.”
  • Fixed [#12922] (VBA): MZ-Tools crashed when closing Microsoft Project.
  • Fixed [#13105] (VS): Operations made active inactive .xaml windows.
  • Fixed [Internal] (VB/VBA): The icon of methods (Sub/Function) was not retrieved correctly in the Favorite Code Elements toolwindow.
  • Fixed [Internal] (VS): Declarations of attributes using the characters “{}” were not parsed correctly.
  • Fixed [Internal] (VS 2012/2013/2015/2017): The Insert Headers buttons has been moved to the left of the Insert Header button.
  • Fixed [Internal] (VB/VBA): The Insert Headers operation didn’t insert headers for child members in some cases.
  • Fixed [Internal] (VS): The scope selector did not show the down arrow in the button of ‘Files matching regular expression’ scope.

About the unresponsive floating toolwindows of MZ-Tools for VBA with some Office 2016 applications

A couple of months ago, in early April, the first reports of “unresponsive”, “blank” toolwindows of MZ-Tools 8.0 for VBA started to arrive. The toolwindows appeared without content and clicking the Close button did nothing. Something like this:

MZ-Tools uses toolwindows for many features such as Method Callers, Review Quality, etc. and the Find Text feature and all of them were affected.

At first I didn’t pay much attention because some users were not able to reproduce the problem, or solved it reinstalling or updating Office. Also, MZ-Tools has tons of users and if the problem was general I would have received tons of bug reports, not two or three.

But some more reports arrived in May and then I decided to investigate. A common pattern emerged:

  • The problem happened always with Office 2016, not with older versions.
  • The problem happened with Word 2016 and PowerPoint 2016 but never with Access 2016 or Excel 2016 (except one case using the Insiders version of Excel, not the regular one). That explained why I didn’t receive tons of bug reports: Excel and Access are the most used Office applications with MZ-Tools and were not affected.
  • Users found a workaround: to dock the toolwindow to some other window (so it was no longer floating), which showed the content inside, and to make it floating again. The problem would happen again in the next session, though.

At first I was not able to reproduce the problem because I was using Excel or Access but as soon as I tested with Word I was. I knew that the problem hadn’t happened until April, otherwise somebody using Word or PowerPoint would have reported it in the last couple of years.

Also I tested with old versions of MZ-Tools 8.0 for VBA (even the first betas of 2015) and the problem was reproduced, so it was not some bug introduced by a recent build of MZ-Tools 8.0.

Yesterday I tested with other third party .NET-based add-ins for the VBA editor and the problem was reproduced. And I tested with the old MZ-Tools 3.0 for VBA (which doesn’t use .NET usercontrols inside toolwindows but ActiveX userdocuments created with VB6) and the problem was reproduced. So it was not a .NET-related problem. It was Office. And to my surprise, I was able to reproduce the problem with no add-in at all, just using the built-in Project Explorer of the VBA editor in floating state rather than in the usual docked state:

  1. Update to some recent version of Office 2016 (1804 or 1805)
  2. Drag the Project Explorer to floating state
  3. Close it
  4. Close the VBA editor and Word 2016
  5. Start again Word 2016 and the VBA editor
  6. Click the button on the toolbar to show the Project Explorer

The Project Explorer toolwindow should appear floating but blank.

Note: you many need to try the whole procedure a couple of times if you have just upgraded or downgraded the version of Office.

Today I have downgraded Office 2016 to previous versions to find which one introduced the problem with the procedure explained at How to revert to an earlier version of Office 2013 or Office 2016 Click-to-Run. And it seems that the problem was introduced by:

Version 1803 (Build 9126.2116) (March 27)

The previous version:

Version 1802 (Build 9029.2253) (March 13)

seems to work fine (although when testing you need to try a couple of times after downgrading or upgrading, maybe because click-to-run upgrades in the background). The date (March 27) of the version 1803 which introduced the problem is consistent with the first bug reports appearing in early April.

I will report this problem to Microsoft. Until a fix arrives, if you are affected by this problem the best approach is to disable Office 2016 upgrades and to revert back to version 1802 (Build 9029.2253).

Update (August 1, 2018): the problem seems to be solved in Version 1807 (Build 10325.20082) (July 25)

New build MZ-Tools 8.0.0.180

A new build of MZ-Tools, 8.0.0.180, has been released today, fixing some bugs. Some of them are quite important, though: one of them fixes crashes that happened unloading Microsoft Project (the root cause is a bug in the extensibility model of that product, but hopefully I have found workarounds to avoid it). Another one for Microsoft Outlook will prevent an error when auto-updating in the next month. And finally, this new build fixes a problem that was happening since 15+ years ago: keyboard shortcuts were executed in Office even if the VBA editor was not the active window (potentially conflicting with keyboard shortcuts of Office). This new build avoids the use of global hotkeys and also recognizes when the VBA editor is active.

The complete changelog is the following:

MZ-Tools 8.0.0.180 released (April 1, 2018)

  • Fixed [#12874] (VS): The Find Text feature didn’t locate results if the end point of a result using regular expressions was between the \r and \n characters.
  • Fixed [#12873] (VB/VBA): The type of a member of a UDT was not parsed correctly if it contained a comment or the “New” keyword.
  • Fixed [#12918] (VB/VBA): Declare Sub and Declare Function were not parsed correctly if they contain comment or blank lines before the declaration.
  • Fixed [#12890] (VBA): Updating MZ-Tools from the VBA editor of Outlook caused error “Cannot start Microsoft Outlook. The command line argument is not valid. Verify the switch you are using.”
  • Fixed [#12881, #11396, #11942] (VB/VBA): Keyboard shortcuts were executed even if the IDE was not the active window.
  • Fixed [#12922] (VBA): MZ-Tools crashed when closing Microsoft Project.

New build MZ-Tools 8.0.0.178

Last week a new monthly build of MZ-Tools, 8.0.0.178, was released with some enhancements and fixes that you have reported in the previous month. The changes are the following:

MZ-Tools 8.0.0.178 released (March 1, 2018)

  • Enhanced [#12782] (All): When closing a result tab, now the previously selected result tab is selected.
  • Enhanced [#12814] (VB): When locating a result, the code window is not scrolled if the line of the result is already visible in the code window.
  • Fixed [#12833] (All): The Replace feature didn’t support “\r\n”, “\r” or “\n” in regular expressions.
  • Fixed [Internal] (All): The Replace feature used \number instead of $number to replace capture groups in regular expressions”.
  • Fixed [#12808] (VB): The line indenter did not parse correctly Type declarations with fields named Type in some cases.
  • Fixed [#12815, #12824] (VB): The line indenter and other features could cause “System.InvalidOperationException: Invalid new line counter” when using conditional compilation and duplicated procedures
  • Fixed [#12799] (VS): The Sort Code Elements feature added quotes to inserted regions in C#.
  • Fixed [#12830] (VS): The Insert Header feature deleted the selected code when executed.
  • Fixed [#12797] (VS): The New Property Assistant didn’t support initializers in auto-implemented properties in Visual Studio 2015 and higher.
  • Fixed [Internal] (VS): The New Property Assistant didn’t support read-only auto-implemented properties in Visual Studio 2015 and higher.
  • Fixed [Internal] (VS): The New Property Assistant didn’t make visible the Automatic style radiobutton after making it invisible.

New build MZ-Tools 8.0.0.176

Today a new monthly build of MZ-Tools 8.0 has been released, with just three bug fixes and a minor enhancement for users of VB6: toolbars are now hidden when entering debug-time or run-time. Since VB6 only allows add-ins to work at design-time, it hides buttons of add-ins at debug/run time. MZ-Tools now hides the whole toolbars, to gain space. This was also the behavior of MZ-Tools 3.0.

Also, starting this month, the setups are digitally signed with a code-signing certificate.

MZ-Tools 8.0.0.176 released (February 1, 2018)

  • Enhanced [#12748] (VB6): The toolbars are now hidden when entering debug-time or run-time.
  • Fixed [#12745] (All): The Private Clipboards didn’t check that the document window was the active window.
  • Fixed [#12757] (VB/VBA): The Find Text feature showed infinite results searching the last word of a code file.
  • Fixed [#12763] (VB6): The content of the clipboard in RTF or image formats was not preserved when loading MZ-Tools.

Happy New Year! And a new build MZ-Tools 8.0.0.175

Happy New Year! A new build 8.0.0.175 was released last January 1 with some enhancements and minor bug fixes.

  • Enhanced [#12708] (All): The previous version of Options files are now kept with the .old extension.
  • Enhanced [#12708] (VB/VBA): The previous version of Task file is now kept with the .old extension.
  • Enhanced [#11687, #12684] (All): Added context menu to the code template editor to cut, copy and paste text.
  • Enhanced [Internal] (VB/VBA): The Code Explorer now sets the focus on the code window when double-clicking a code element or pressing the Enter key.
  • Fixed [#12691] (All): The Show Code Elements toggle button on the toolbar of the results window didn’t reflect the state of the selected tab.
  • Fixed [#12691] (All): The Show Code Elements toggle button on the toolbar of the results window didn’t initialize the Show Code Elements checkbox of the Find Text toolwindow.
  • Fixed [#12722] (VB/VBA): The preselected file or project in the scope selection window of an operation was not correct when using the context menu of the Project Explorer.
  • Fixed [#12721] (VB/VBA): The New Method/Property Assistant generated invalid code if all the lines from the insertion point until the end of the document were blank lines.
  • Fixed [#12465, #12474, #12591, #12724] (VB/VBA): The Code Explorer didn’t parse correctly multiline constants.

MZ-Tools 8.0.0.174 released with two new predefined variables and some bug fixes

The last public build of MZ-Tools 8.0 this year was released a couple of days ago (next one is scheduled for January). This build 8.0.0.174 introduces two new predefined variables for code templates, etc. and some bug fixes:

  • Enhanced [Internal] (All): The Nomenclature Rules Review now shows a better message when the case of the name is not correct and it uses prefixes or suffixes.
  • Enhanced [#12625] (All): New predefined variable “Guid” ($P[GUID]).
  • Enhanced [#12581] (All): New predefined variable “Method Property Kind” ($P[METHOD_PROPERTY_KIND]).
  • Fixed [#12591] (VB/VBA): Hidden types (such as Excel.CheckBox) were not shown in the type tag editor.
  • Fixed [#12591] (All): The Nomenclature Rule editor showed a wrong example when using the $P[TYPE_TAG_WITH_UPPER_CASE] predefined variable.
  • Fixed [#12634] (VBA): COMException HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER) could happen in some VBA hosts.
  • Fixed [#12654, #12631] (VS): The dialog to select the exception handler or header crashed Visual Studio.

MZ-Tools 8.0.0.172 released with bug fixes

A new monthly build of MZ-Tools 8.0 was published last November 1. It introduces an enhancement to replace contents of existing VBA files when importing, rather than duplicating the file, and some bug fixes. The complete change log is the following:

  • Enhanced [#12516] (VBA): The Import Files feature now replaces the contents of existing items.
  • Fixed [#12553] (VB/VBA): The Line Indenting feature didn’t handle correctly line continuations at the end of a comment followed by a blank line.
  • Fixed [#12559] (VB/VBA): The Select Case Assistant didn’t work in properties, only in methods.
  • Fixed [#12562] (VBA): The Development Environment Settings Review did not run on startup.
  • Fixed [#12575] (All): Entering by accident in the dialog to enter user-defined variable values a user-defined variable name hung the IDE.

 

MZ-Tools 8.0.0.169 released with bug fixes

As usual, today a new monthly build of MZ-Tools has been released. This time with a small usability enhancement and some bug fixes.

The changelog is the following:

  • Enhanced [#12424] (All): The user options window now remembers the last used setting to keep open modified documents or not.
  • Fixed [#12376] (All): The HTML documentation didn’t handle correctly constants and fields.
  • Fixed [#12234] (VB/VBA): The Code Explorer could still cause System.NullReferenceException when closing.
  • Fixed [#12384] (VB/VBA): Constants and variables of properties were not reviewed by the Review Quality feature.
  • Fixed [#12386] (VB/VBA): Multiple constants/fields declared using line continuation were not parsed correctly.
  • Fixed [#12387] (VB/VBA): Declarations of Declare Function/Sub using a line continuation were not parsed correctly.
  • Fixed [#12391] (VB/VBA): COMException happened refreshing results if the scope was current file and the file had been removed and readded.
  • Fixed [#12410] (VB/VBA): Error “Failed to get command bar name of: CommandBarKinds.MenuBar” if the File menu entry was not the first one on the main menu.
  • Fixed [Internal] (VB/VBA): The Code Explorer didn’t show Declare Sub / Declare Function code elements.

MZ-Tools 8.0.0.168 released introducing collector of ‘ TODO: tasks in code

Today MZ-Tools 8.0.0.168 has been released. It fixes an important performance bug that can happen using the Select Case Assistant for VBA/VB6/VB5 and other minor bugs but, more importantly, it introduces a quite requested feature: a collector of TODO tasks in code for those IDEs. MZ-Tools 8.0 already provided a Task List, but it was for tasks entered by hand, now called “general” tasks:These tasks are entered manually through a dialog and are not tied to code:

This new build provides a new tab in the Task List for “code” tasks, that are comments in code that start with ‘ TODO: or ‘TODO: (without space):

This features scans all the code of your project showing those types of comments. Hopefully you find this feature useful.

The complete changelog is the following:

  • Enhanced [#12326] (VB/VBA): The Task List provides now a new tab page to show code tasks (‘ TODO: comments) apart from general tasks.
  • Enhanced [#12287] (All): The commands GenerateXmlDocumentation and GenerateHtmlDocumentation can be now automated.
  • Fixed [#12312] (VS): NullReferenceException loading MZ-Tools on Visual Studio 2010, 2008 or 2005. This bug was introduced in last build 8.0.0.164
  • Fixed [#12307] (VS): The Add Line Numbers feature numbered lines after initializer ‘=’ in VB.NET 10.0 or higher.
  • Fixed [#12234] (VB/VBA): The Code Explorer could still cause System.NullReferenceException when closing.
  • Fixed [#12247] (VB/VBA): The Select Case Assistant didn’t parse correctly enum items with comments or conditional compilation directives.
  • Fixed [#12247] (VB/VBA): The Select Case Assistant could be very slow in some scenarios.
  • Fixed [#12347] (VBA): Using MSForms, pages of a MultiPage control were not retrieved on Windows 7.
  • Fixed [Internal] (All): The window to select a code template didn’t have the correct tab order.