MZ-Tools 7.0 Build 116 released with bug fixes

MZ-Tools 7.0.0.116 has just been released with a few bug fixes, most of them to provide a better experience with 3rd party software:

  • Fixed: The Sort Code Elements feature didn’t preserve comments in the same line of the “end region” keyword.
  • Fixed: Some critical exceptions were being silenced.
  • Fixed: A System.IO.IOException could happen when using Windows 8.1 and SkyDrive to store the team options.
  • Fixed: Improved support for 3rd party TabControls.
  • Fixed: The picture of some 3rd party controls using .ico files as bitmap was not shown in the Control Explorer.
  • Fixed: 3rd party controls using the HKEY_CURRENT_USER hive could cause “ICollectionItemEditor.InitializeControlValues failed” in the Options window.

System.IO.IOException: “The file cannot be accessed by the system” using Windows 8.1 and SkyDrive

If you are using SkyDrive to store the Team Options of MZ-Tools 7.0 (to share them among several computers of yours), you can get the following error on Windows 8.1 (but not on Windows 7 or Windows 8):

“System.IO.IOException: The file cannot be accessed by the system”

IOException

This issue will be addressed in the next build to fail more gracefully with a friendly explanation, but meantime the workaround is the following:

  • Using Windows Explorer, right-click the folder to show its context menu.
  • Click the “Make available offline” menu entry.

Installing MZ-Tools 3.0 for VBA for non-admins

The most common question that I receive about MZ-Tools 3.0 for VBA is how to install it without administrator rights or the variant “I don’t see MZ-Tools after an administrator installed it”.

The short answer is that you can’t install MZ-Tools 3.0 for VBA without being an administrator. This is because the add-in dll must be registered as COM component, and in this version 3.0 it uses machine-wide COM-registration (using the HKEY_LOCAL_MACHINE registry hive, like regsvr32.exe does).

Note: It happens that per-user COM-registration is possible (not requiring admin rights), and the new major version MZ-Tools 8.0 for VBA will avoid this problem. But meantime, you need to persuade an administrator to install it as the first step.

Once an administrator has installed the add-in, a problem remains: VBA add-in registration (which is different from COM-registration) is badly designed and the VBA editor only looks for add-ins in the HKEY_CURRENT_USER registry hive. So, when the administrator installed the add-in, it wrote registry entries in her HKEY_CURRENT_USER registry hive. Since they are missing in your HKEY_CURRENT_USER registry hive, you “don’t see” the add-in. Fortunately nothing prevents you writing in your HKEY_CURRENT_USER registry hive even lacking administrator rights, so you can create a program with any technology (.NET, VB6, VBA macro, VBScript, PowerShell, etc.) to write these entries:

HKEY_CURRENT_USER\Software\Microsoft\VBA\VBE\6.0\AddIns\MZTools3VBA.Connect

Name: Description
Type: REG_SZ
Value: MZ-Tools 3.0 for VBA

Name: FriendlyName
Type: REG_SZ
Value: MZ-Tools 3.0 for VBA

Name: LoadBehavior
Type: DWORD
Value: 3

In the FAQ entry about this issue I have provided a PowerShell script that writes those entries.

MZ-Tools 7.0 Build 115 released with bug fixes

MZ-Tools 7.0.0.115 has just been released with a couple of bug fixes and a small enhancement that a customer requested:

  • Fixed: When closing Visual Studio 2010 or higher, a “System.ApplicationException: Error adding the DTE command with name ‘X’ due to the following cause: A Command with that name already exists.” error could happen if CodeRush (and maybe other DXCore-based DevExpress products) is also installed.
  • Fixed: The Sort Code Elements feature no longer shows an exception if regions are not correct in the source code.
  • Fixed: The Sort Code Elements feature now allows to keep the existing order of fields (not only of constants).

MZ-Tools 7.0 Build 113 released with bug fixes

MZ-Tools 7.0.0.113 has just been released with several bug fixes:

  • Fixed: The Programming Rules Review feature could cause “System.Runtime.InteropServices.COMException (0×80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.” at EnvDTE80.CodeParameter2.get_ParameterKind().
  • Fixed: The Control Explorer and other toolwindows didn’t work correctly when docked as documents.
  • Fixed: The Sort Code Elements feature removed commented lines at the end of code regions.
  • Fixed: The Control Explorer controls were not correctly placed the first time that the toolwindow was shown.
  • Fixed: Commands of code templates and exception handlers were not created the first time that MZ-Tools was loaded in a new Visual Studio version.
  • Fixed: The result of a Programming Rule Review using the Code property was not correctly located in the code window.
  • Fixed: Entering an invalid regular expression in the “Files Matching Regular Expression” scope caused System.ArgumentException.
  • Fixed: The Add Line Numbers feature didn’t numbered a Select Case statement after certain comment lines.
  • Fixed: The declaration of method variables was not parsed correctly.

MZ-Tools 7.0 Build 111 released with Visual Studio 2013 Preview support

MZ-Tools 7.0.0.111 has just been released with support for Visual Studio 2013 Preview and a couple of bug fixes:

  • Enhanced: Added support for Visual Studio 2013
  • Fixed: The New Property Assistant added the property header above the class for empty classes.
  • Fixed: The TabIndex Review showed false errors if there were controls that don’t have the TabIndex property (such as PictureBox controls).

MZ-Tools 3.0 Build 1211 released with important fix for Access users

MZ-Tools 3.0.0.1211 has just been released with the fixes below.

  • Fixed: Forms and reports that are opened automatically by Microsoft Access when using the add/remove line numbers features are now closed by MZ-Tools.
  • Fixed: The setup caused error 0×5 if Visual Studio 2013 Preview was installed on the system, because the MSADDNDR.DLL file installed by Visual Studio 2013 Preview is a higher version but it is not backwards compatible.
  • Fixed: Added hidden “IgnoreControlArraysForTabIndex” setting to force comparison of positions of controls in an array when using the TabIndex Assistant feature.

The first one can prevent an “Out of memory” error when adding / removing line numbers in the VBA editor of Microsoft Access databases because now MZ-Tools closes the forms and reports that Access opens automatically when editing their code files. This issue has affected a number of users in the last years (at least since Access 2007) but now a workaround has been implemented.

The second one prevents an error installing MZ-Tools if you have installed Visual Studio 2013 Preview.

Setup of MZ-Tools 3.0 for VBA causes error 0×5 if Visual Studio 2013 Preview installed

In the last couple of days two users of MZ-Tools 3.0 for VBA have reported that the (latest) setup failed with error “Unable to register DLL/OCX:RegSvr32 failed with exit code 0×5″.

After some investigation, I have found that the problem happens if Visual Studio 2013 Preview is installed on the system, and the root cause is that it installs a MSADDNDR.DLL file with version 12.0.20617.1 in the folderĀ C:\Program Files (x86)\Common Files\designer that is not backwards compatible with the version 6.0.81.69 that MZ-Tools 3.0 for VBA uses (and since the installed version is a higher, it is not replaced by the setup).

I have reported the problem to Microsoft here:

MSADDNDR.DLL 12.0.20617.1 installed by VS 2013 Preview breaks setups of VBA add-ins
http://connect.microsoft.com/VisualStudio/feedback/details/793386/msaddndr-dll-12-0-20617-1-installed-by-vs-2013-preview-breaks-setups-of-vba-add-ins

The next build of MZ-Tools 3.0 will fix the problem forcing the installation of MSADDNDR.DLL 6.0.81.69. Meantime, as a workaround, you can rename the existing file before installing MZ-Tools 3.0 for VBA.

MZ-Tools 7.0 Build 110 released with bug fixes

MZ-Tools 7.0.0.110 has just been released. The list of bug fixes is the following:

  • Fixed: The Dead Code Review could cause “System.ArgumentNullException: Value cannot be null.” or “System.NotSupportedException: The given path’s format is not supported.” with projects that don’t generate an output assembly (such as web site projects)
  • Fixed: The Collapse Projects feature could cause NullReferenceException with Visual Studio in Japanese.
  • Fixed: The Insert Code Element Header feature inserted several File headers (as many as “using/Imports” statements in the file).