Skip to content

Getting your Add-ins to Work in Vista, Part 1

How to get Access add-ins to work in Access 2007 running on Windows Vista.

Access Archon # 162

 


Introduction

I have add-ins that were originally developed in Access 97 that have worked in all versions up through 2003, and others that had features new to Access 2000 or Access XP (2002) that also work in Access 2003.  But when I tried using these add-ins in Access 2007 running on Vista, I couldn’t get any of them to work.  This is not really an Access problem, since the same add-ins work fine in Access 2007 running on Windows XP, but it is a real problem all the same.  In this article I explain what you have to do in order to get Access add-ins to work in Access 2007 running on Windows Vista.


Add-in Syntax Changes

Access add-ins from Access 97 through Access 2003 used the following syntax in the USysRegInfo for a menu add-in:

HKEY_CURRENT_ACCESS_PROFILEMenu Add-ins&Back up Database

where “Back up Database” is the name of the menu add-in.  In Access 2007 running on Vista, this syntax won’t work:  you have to capitalize the “i” in “Add-ins,” making the line:

HKEY_CURRENT_ACCESS_PROFILEMenu Add-Ins&Back up Database

Why Microsoft made this change is beyond me; word is that this change of capitalization will not be required when Office 2007 gets its first service pack.  But in the meanwhile you need to edit your UsysRegInfo tables to change the capitalization of “Add-ins”.  To modify the add-in’s USysRegInfo table, start by opening the add-in’s library database.  If you don’t see the USysRegInfo table, click the Office button and then click the Access Options button to open the Access Options dialog.  Select the Current Database page, then click the Navigation Options button to open the Navigation Options dialog.  Finally, check the Show System Objects checkbox, as shown in Figure A.

Figure A.  Showing System Objects in Access 2007

This capitalization change (and installing the add-in in Administrator mode, as described below) is the only change you need to get a Menu add-in to work in Vista.  But other add-in types are more problematic; if you have Wizards or Property Builders in your add-in, you will need to make further changes to the UsysRegInfo table syntax for those add-ins, which unfortunately will make them unusable in earlier versions of Access.  My LNC Rename add-in includes Property Builders, so I am using it as the sample add-in database for this article.  (For more information on writing and using add-ins in Access 2007 on Windows XP or Vista, see my new Wiley book, Access™ 2007 VBA Bible For Data-Centric Microsoft® Applications, which should be out any time now, perhaps by the time you read this article).

While Menu add-ins can be installed to the HKEY_CURRENT_ACCESS_PROFILE key in the Registry, which enables them to work with whatever version of Access is currently running, if you want your add-ins to run in Vista, Wizards and Builders need to be installed to the more restrictive HKEY_LOCAL_MACHINE key, which specifies the Office version.  Thus, even if your add-in library database is in the older .mda format, the Wizard and Builder add-ins won’t work in older versions of Access.  For consistency, I changed the Registry key to
HKEY_LOCAL_MACHINESOFTWAREMicrosoftOffice12.0Access
for all the rows of the UsysRegInfo table.

Because of the need to use the HKEY_LOCAL_MACHINE key of the Registry, which means that the add-in will only work for Access 2007, I also converted the library database from the .mda format to .accda (Access 2007 library database format), to make it clear that this version is specific to Access 2007.  If the promised Service Pack makes it possible to use the HKEY_CURRENT_ACCESS_PROFILE for Wizards and Builders (as in previous versions of Access), I can make an .mda version of the add-in that will work with all Access versions from Access 97 through Access 2007.

In addition to the generic changes that are needed for all add-ins to work in Access 2007 running on Vista, for this specific add-in (which dates from Access 97), there is also an issue with Rick Fisher’s Find And Replace (FAR) add-in, which my add-in uses (with Rick’s permission) for some of the renaming (references to renamed objects in VBA code).  You need to download and install FAR in order for the LNC Rename add-in to work.  A 30-day trial version is available from Rick’s site.  The latest version of this add-in is v. 9.0i; a version for Access 2007 is in development, but the beta is not yet ready to download.  (See the Beta tab of the RickWorld Web site for updated information on beta availability.)

After modifying the LNC Rename add-in as needed, and converting it to the new Access 2007 .accda library database format, and installing it in Administrator mode, I found that the property builders worked fine, and so did renaming of objects and controls, but there were problems with the calls to FAR (used to rename object references in code).  I got a message from FAR noting that it was not tested for Office 12.0, and then one or more error messages, like the one in Figure B.  Because of the problem with Access 2007, the calls to FAR will fail, and references to renamed objects in code (if any) won’t be changed (at least, until the Access 2007 version is released), but you can click OK on the FAR error message(s) and the objects and controls will still be renamed correctly, since that functionality is supported by the LNC Rename add-in itself.

Figure B.


Supporting Files

The zip file containing this article, in Word format, plus the supporting file(s), may be downloaded from the Access Archon page of my Web site.  It is accarch162.zip, which is the last entry in the table of Access Archon columns for Access Watch.











Document Name

Document Type

Place in

LNC Rename.accda

Access 2007 library database

Addins folder, for Vista usually C:UsersUser NameAppDataRoamingMicrosoftAddIns

 

About this author