Application Error in Word or Excel

Problems caused by the ActiveX Control (V10)

When you insert a barcode from the TBarCode Office 10 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.

Incompatible Plugins

Please verify if you have installed other third party plugins, which may interfere with the TBarCode/Office add-in. We received customer reports about issues with the Dymo® Label printer plugin, the Showcase Query Add-In, the Autodesk® Inventor® and Adobe® PDFMaker (when installed in parallel).

Roaming User Profiles

There were problems reported with Roaming User Profiles (e. g. you see "Faulting module name: KERNELBASE.dll" in the event log). According to Microsoft, ClickOnce based VSTO add-ins are not supported with roaming user profiles.

TBarCode Office Listed as Inactive Application-Add-In

Office 2010, 2013, 2016+

Download the latest service pack (SP) for your Office version: Download Office Updates (Service Packs). For instance, Office 2010 needs SP2 for the add-in to work correctly. Furthermore check your Office version for available updates: Install Office Updates.

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: Office 2007 Service Pack 3

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.

When installing again, don't enable the "All Users" option with Office 2007. In the TBarCode Office setup, click Options and disable All Users before you continue.

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.

Antivirus

If your antivirus solution is blocking specific files, there may be .NET runtime errors like "0xc0000005 - Unexpected parameters" during the startup of the add-in. This causes the add-in to be disabled.

TBarCode Office Listed as Disabled Application-Add-In

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.
  • Temporarily disable your antivirus to determine if it is blocking file access and causing the add-in to be disabled.

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 11/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. This may happen with a per user installation (e.g. the "All Users" option is disabled for Office 2007). 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 11\bin\Word
C:\Program Files (x86)\TEC-IT\TBarCodeOffice 11\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.

Upgrading Documents from V10 to V11

You have a situation where your documents were created with V10.8.4 (or earlier), and you are planning to update to V11. However, the barcode objects from V10.8.x are not compatible with V11. In V10.8 (and partially in V10.9 as well), we used ActiveX Controls for the barcodes, but in V11, we use EMF pictures instead.

In V11, you can insert a new bar code anytime, but what happens to the existing documents? The answer lies in the Conversion Wizard in 10.9. In case you want to upgrade the documents too, follow these steps:

  1. Install V10.9.5 (the license key is the same as before with 10.8 or earlier)
  2. Open the documents with the barcode(s)
  3. Confirm the Conversion Wizard popup with Yes: The document will be scanned, and the Barcode ActiveX Controls will be converted to a EMF images.
  4. Test the document / barcodes: Verify the size, barcode type, data, and if mail merge or linked-to-cell barcodes are updated as desired.
  5. EMF barcodes are updated only during printing and (if enabled in the add-in options) during saving. After the conversion, barcodes (ActiveX®) programmed in VBA will no longer work with EMF images. For VBA programming, we offer the TBarCode SDK!
  6. Save the document.

Repeat steps 2 - 5 for every document where you want to access barcodes with V11. Once the documents are updated/migrated in V10, uninstall V10 and install V11 (which requires a new license key).

The “migrated” documents can also be opened later with V11. If the documents are not migrated, the barcode becomes inactive and must be inserted again in V11. This is due to the technology change (previously, ActiveX controls were used, but now we use EMF images).

If the documents are not used but only archived, there is no need to migrate to EMF images. This only applies to actively used documents where the barcodes are updated regularly (e.g., Excel spreadsheets with linked cells or Word mail merge documents).

Silent Setup Without User Interaction

TBarCode Office V11

Use the standard EXE setup program, which is available for public download. If you want to install the add-in in quiet mode run the setup this way:

TBarCodeOffice.exe /install /quiet

Optional: You can add the installation folder as separate parameter.

TBarCode Office needs the Microsoft Visual C++ Redistributable (V14.0.24215 or later) as a pre-requisite. The setup will download and install this package automatically if not present on the target system. If downloading is not possible due to security restrictions, the setup will fail. Alternatively you can copy the vc_redist.x86.exe and vc_redist.x64.exe (use correct version!) into the setup path and it will be executed from there.

Log Setup

You can create a log file in a specific path by calling the setup with the following arguments:

TBarCodeOffice.exe /install /log "c:\temp\log.txt"

More Options

Please run the EXE with option -? to see all available command line options.

TBarCodeOffice.exe -?

TBarCode Office V10

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"

Uninstall

You can suppress the feedback page during uninstall with the NO_UI property set to 0.

TBarCodeOffice.exe /x /q /ComponentArgs "TBarCode Office x64":"NO_UI=0"
                         /ComponentArgs "TBarCode Office":"NO_UI=0"

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).