Application Error in Word or Excel

When you insert a barcode from the TBarCode Panel your Word or Excel instance stops working. In the Event Log (run eventvwr on command line) you see an APPCRASH event with error code 0xC0000005 in the module MSVCR90.dll. This problem may occur after you have updated to Windows Version 10 (Version 1709).

When you open a document, which contains a bar code control your Word or Excel instance stops working. This problem occurs after you have updated to Windows Version 10 (Version 1803).

Replace ActiveX Controls with EMF Barcodes

Starting with version 10.9 of the add-in you can replace the barcode controls in your document with EMF pictures. This improves the program stability. For an easy upgrade of your documents to EMF barcodes you can use the conversion wizard (see add-in options).

This would be the preferred solution. If you cannot change to EMF bar codes, the alternative workaround would be to use the compatibility troubleshooter (see below).

Program Compatibility Troubleshooter

Run the Compatibility Troubleshooter (see links below) and enable Windows 7 or Windows 8 compatibility mode for the faulting Office application(Excel or Word).

In addition:

  • Make sure you have the latest Office service packs for your Office version installed.
  • Make sure you use the latest VSTO version and .NET version available.

TBarCode Office Listed under Inactive Application-Add-Ins

Office 2010, 2013, 2016+

Download the latest service pack (SP) for your Office version from here:

For instance, Office 2010 needs SP2 for the add-in to work correctly. Please verify also your Office version if you need an update.

After updating your Office installation you may need to re-activate the Add-In: How to: Re-enable an Add-in That Has Been Disabled

If the add-in already worked before and suddenly (e.g. after a Windows update) becomes inactive, try an Office Repair. In addition, make sure that you have the latest add-in version installed.

Office 2007

You need Service Pack 3 to be installed. You can download this service pack from Microsoft:

In several cases a new installation combined with cleaning the VSTO cache may be required. The cache cleaning script/tool can be downloaded here. Uninstall, execute the cache cleaning, then install again. Don't enable the "All Users" option with Office 2007.

After updating your Office installation you need to re-activate the Add-In: How to: Re-enable an Add-in That Has Been Disabled

If the add-in already worked before and suddenly (e.g. after a Windows update) becomes inactive, try an Office Repair.

VSTO Runtime

In some cases it may help to update the Visual Studio 2010 Tools for Office Runtime (VSTO Runtime). You can download the VSTO Runtime installer from the link below. If this update helped in your case, please give us feedback and let us know (thanks!).

Roaming User Profiles

There were problems reported with Roaming User Profiles (e. g. you see "Faulting module name: KERNELBASE.dll" in the event log). Temporarily switch to a local user profile to see if the problem is caused by the roaming profile. After new logon or reboot try to activate TBarCode Office in Options - Add-In - Manage COM Add-ins. If TBarCode is not listed there, try a complete reinstall.

TBarCode Office Listed under Disabled Application-Add-Ins

Under specific circumstances Word or Excel disables Application Add-Ins completely, e.g. when the loading time exceeds a limit or when a fatal error occurred during loading.

  • Verify if you have installed the latest service packs for your Office (see also the links in the previous FAQ).
  • Perform an Office Repair if the problem occurs after a recent Office update.
  • Make sure you avoid Roaming User Profiles as they may cause instability with the add-in.
  • In several cases a new installation of the add-in combined with cleaning the ClickOnce App Cache may be required - see Repairing a Corrupt ClickOnce Application Cache.

How to re-enable the Add-In is described here: How to: Re-enable an Add-in That Has Been Disabled.

Tweak Manifest URL File Prefix

In some cases, where the Excel add-in could not be enabled, the file prefix of the manifest URL needed a modification:

  • Open regedit and locate the following registry key (for current user installation)
    HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\TECIT.TBarCode.ExcelAddIn
  • For an all-users installation, locate the key in the HKLM hive (including Wow6432Node).
  • In the Manifest string value remove the file:/// prefix, the resulting URL should look like C:/Program Files (x86)/TEC-IT/TBarCodeOffice 10/bin/Excel/TECIT.TBarCode.ExcelAddIn.vsto
  • Try to re-enable the add-in again.

Add-In Not Loaded for Terminal Server Users with Restricted Permissions

Problem: The add-in can be loaded by an administrator - but not by a normal user with restricted privileges.

Users connecting through the Terminal Server have access permissions to the Remote Desktop (local) but are usually not allowed to make changes within the setup or parameters (in components, tools, applications, etc.).

The error when loading the add-in may also be due to the fact that these users are not authorized to read or execute the configuration file machine.config in C:\Windows\Microsoft.NET\<Framework | Framework64>\v4.0.30319\Config.

As tests have shown: If you allow the affected users to read and write the machine.config file, the add-in may be loaded.

Summarized:

  • Granting Permissions to Remote Desktop Users (Local)
  • Granting permissions to read and execute the machine.config file (local)

Add-In is Only Available for the User who has run the Setup

After TBarCode Office installation, the add-in is only visible for the user who has installed the product (e.g. the Administrator), other users can not see the add-in. Use one of the two options below to solve this problem.

Register the Add-In VSTO File for the Actual User

In order to make the add-in available for another user, you have to register the Office VSTO files for the actual user account again.

To do so, login under the user account, switch to the installation folder - e. g.

C:\Program Files (x86)\TEC-IT\TBarCodeOffice 10\bin\Word
C:\Program Files (x86)\TEC-IT\TBarCodeOffice 10\bin\Excel
and execute TECIT.TBarCode.WordAddIn.vsto and TECIT.TBarCode.ExcelAddIn.vsto with a double-click. Then restart Word and Excel. Now, the add-in should also be visible for the actual user account.

Register the Add-In for all Users in HKLM

TBarCode Office 10.4 (and later) offers an option for registering the add-in for all users in the setup program. This option will create an entry in the HKLM registry hive. If you currently have installed a previous version you have to uninstall it first.

Please note that only Office 2010 (and newer) support machine wide registering of VSTO add-ons. Users of Office 2007 would need this hotfix from Microsoft.

Installing Office Customization Error During Startup of Word/Excel

Exception Reading Manifest from Word/Excel VSTO File

During startup of Word or Excel you receive a System.Deployment.Application.InvalidDeploymentException with error message The manifest may not be valid or the file could not be opened.

The following updates may solve the problem:

  • Update to .NET Framework 4.7 from here.
  • Update the Visual Studio 2010 Tools for Office Runtime (VSTO Runtime) from here.

'DeploymentProviderUri Not Valid' and Other Error Messages

During startup of Word or Excel you receive a System.Deployment.Application.DeploymentException with error message Store metadata "DeploymentProviderUri" is not valid (or a different exception message).

Cleaning the App Cache may resolve the problem - see Repairing a Corrupt ClickOnce Application Cache.

Repairing a Corrupt ClickOnce Application Cache

The VSTO installer uses ClickOnce technology from Microsoft to install the add-in for the current user (not used with "All Users" option). ClickOnce applications and add-ins are installed into a specific user directory from where they are executed. This directory (or cache) may be corrupted resulting in errors during installation.

There are several methods with different effectiveness to repair or clean up the ClickOnce application cache. Perform the following steps one after the other.

Clear the Application Cache with Mage

  • Download the cache cleaning script from here.
  • Uninstall the add-in, execute the CustomCacheCleaning.cmd, then install the add-in again.
  • When you install the add-in, don't enable the All Users option with Office 2007.
  • We recommend to update to the latest add-in version.

Cache Cleaning with dfshim.dll

Run the following command from an Administrator elevated command prompt:

rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache

This should repair the ClickOnce cache.

Deleting the ClickOnce Cache

If the previous commands do not resolve the issue, it may be necessary to remove the ClickOnce application cache completely:

  • In Windows Explorer, enter the following path: %LOCALAPPDATA%\Apps\2.0
  • After that you should be in the C:\Users\<UserName>\AppData\Local\Apps\2.0 folder.
  • Backup all folders to a safe location.
  • Delete all folders in the \2.0 folder. This removes the ClickOnce file cache from the system and can influence also other Add-Ins or ClickOnce Apps.
  • Uninstall and install TBarCode Office new.
  • The above cache folder will be recreated automatically.
The solution above is for experienced users only - no liability given! See also ClickOnce Application Fails to Update.

Silent Setup Without User Interaction

To install TBarCode Office without user interaction, run the setup with the following command line arguments

TBarCodeOffice.exe /i /q
Starting with TBarCode/Office 10.5.7 the "All Users" option is selected automatically if Office 2010 (or newer) is found.

Install For All Users

TBarCodeOffice.exe /i /q /ComponentArgs "TBarCode Office x64":"ADDIN_ALLUSERS=1"
                         /ComponentArgs "TBarCode Office":"ADDIN_ALLUSERS=1"

The all users option is available starting with TBarCode Office 10.4.

Install Only for Current User

TBarCodeOffice.exe /i /q /ComponentArgs "TBarCode Office x64":"ADDIN_CURRENTUSER=1"
                         /ComponentArgs "TBarCode Office":"ADDIN_CURRENTUSER=1"

The current user option is available starting with TBarCode Office 10.8.3.

Install Only Excel Add-In

TBarCodeOffice.exe /i /q /ComponentArgs "TBarCode Office x64":"ADDLOCAL=Feat_ExcelAddIn"
                         /ComponentArgs "TBarCode Office":"ADDLOCAL=Feat_ExcelAddIn"

Log Setup

You can create two kinds of log files by calling the setup with the following arguments:

TBarCodeOffice.exe /i /Log /LogFile wlog.txt

TBarCodeOffice.exe /ComponentArgs "TBarCode Office x64":"/l*v clog.txt" 
                   /ComponentArgs "TBarCode Office":"/l*v clog.txt"

No Barcode Add-In available on Windows XP

Consider this tip if the barcode add-in was installed but fails to load (= not visible) in Word 2007 or 2010 on Windows XP.

Most likely you need to install the Primary Interop Assemblies (PIA) manually. This package is available on request or can be downloaded from Microsoft:

  1. First install the Primary Interop Assemblies package.
  2. Then start Microsoft Word 2007 and open the Word Options.
  3. Switch to the Add-Ins tab, then select COM Add-ins from the Manage menu and click on Go...
  4. Activate the entry TEC-IT TBarCode Office (Word Add-In) in the upcoming COM Add-ins dialog and confirm with OK.
  5. After restarting the Add-Ins tab will appear and the TBarCode Office Add-In will be available.

Crash in OSF.DLL When You Close Word or Excel

The crash occurs in the OSF.DLL (a DLL from Microsoft) and not directly in our software. We did some research and have seen that (independent from installation of our product) there may be several reasons:

  • Some people located the problem in the Antivirus software they have used.
  • For some other people it helped to sign out of the MS Office account.
  • In one case the problem was the graphic card / graphic card driver (it worked on a different PC with different hardware).

We have feedback that in one case an older version of TBarCode Office (10.5.) does not show up this problem. You can download it from here. Be aware that this older version lacks some of the features and fixes introduced in newer versions.