"Could not load file or assembly . . ." errors might occur with SAS® Add-In for Microsoft Office


When you use SAS Add-In for Microsoft Office, you might receive an error that is similar to the following when you invoke an Office application such as Microsoft Excel:

Application Error
SAS Add-In for Microsoft Office has encountered a problem
We recommend that you save your work and restart SAS Add-In for Microsoft Office.
------------------------------------------------------------------------------------------
Exception information
------------------------------------------------------------------------------------------

Could not load file or assembly 'GTLManagedWindowsInterfaces, Version=7.200.0.0,
Culture=neutral,
PublicKeyToken=eb9055375dfaa0cd' or one of its dependencies. Access is
denied.

-------------------------- Technical Information Follows --------------------------
Exception Details:
----------------------------------------
Exception type:  System.IO.FileLoadException
Message:         Could not load file or assembly 'GTLManagedWindowsInterfaces,
Version=7.200.0.0, Culture=neutral, PublicKeyToken=eb9055375dfaa0cd' or one of its
dependencies. Access is denied.
Source:          SAS.OfficeAddin
Target Site:     Load

Stack Trace:
   at SAS.OfficeAddin.OfficeAddinBase.Load()
   at SAS.OfficeAddin.ExcelAddin.Load()
   at SAS.OfficeAddin.Connect.CreateAddIn()
   at SAS.ExcelAddIn.VstoExcelAddIn.CreateAddIn()

Additional errors might be similar to the following:

Exception while collecting installationInformation.
Could not load file or assembly 'Xceed.Zip.v5.1, Version=5.1.12266.12120, Culture=
neutral,
PublicKeyToken=ba83ff368b7563c6' or one of its dependencies. Access is denied.

Exception type:  System.IO.FileLoadException
Message:         Could not load file or assembly 'Xceed.Zip.v5.1, Version=5.1.12266.12120,
Culture=neutral, PublicKeyToken=ba83ff368b7563c6' or one of its dependencies.
Access is denied.

Source:          SAS.EG.InstallInfo
Target Site:     .ctor

Could not load file or assembly 'file:///path\GTL-Managed-Windows.dll' or
one of its dependencies. The system cannot find the file specified.

In the error above, the path value is unique to your environment.

Here is another example of an error in Excel: 

Varying scenarios could cause this behavior. The following sections describe these scenarios and how to work around them.

Scenario 1 (Most Common): There Is a Bitness Mismatch between Microsoft Office and SAS® Add-In for Microsoft Office

This scenario occurs most often. SAS Add-In for Microsoft Office and Microsoft Office must be the same bitness. The bitness mismatch might occur when SAS Add-In for Microsoft Office is installed before Office is installed. If Office is installed later, it might not be the same bitness as the SAS add-in that was installed first. Also, the bitness mismatch can occur if Office is upgraded and the upgraded version of Office is a different bitness than the version of Office that was previously installed.

To work around the issue, uninstall SAS Add-In for Microsoft Office, and then re-install it. When you re-install SAS Add-In for Microsoft Office, the installation process determines the Microsoft Office bitness and then installs SAS Add-In for Microsoft Office with the bitness that matches.

Note: During the re-installation of the SAS add-in, if a prompt about the mode for the SAS add-in occurs, select the appropriate mode that corresponds to the Office bitness. For 32-bit Office, select 32-bit Mode. For 64-bit Office, select 64-bit Mode.

Scenario 2 (Less Common): A Bitness Mismatch Occurs Due to Your Revision of SAS® 9.4

This scenario occurs only when Microsoft Office is 32-bit and SAS Add-In for Microsoft Office is installed from SAS 9.4 TS1M1, Rev. 14w25. This revision had missing 32-bit components, which forces the SAS add-in installation to be 64-bit. Then the bitness mismatch occurs. See SAS Note 53605 ("During the installation of SAS® 9.3 or SAS® 9.4, Rev. 14w25, some Microsoft Windows 32-bit SAS® software components are not installed") for more information about SAS 9.4 TS1M1, Rev. 14w25.

To work around the issue, uninstall the 32-bit Office installation and re-install 64-bit Office. Another alternative is to obtain a new order for SAS 9.4 TS1M2, Rev. 14w47 or higher. Then install the SAS add-in from the new order.

Scenario 3 (Rare): DirectX 10 Is Installed on a Windows Server 2008 64-Bit Machine

This scenario occurs when you apply a hot fix for SAS Add-In 6.1 for Microsoft Office on a Windows Server 2008 64-bit machine that also has DirectX 10 installed. The issue occurs after you apply the hot fix and then invoke Excel.

To work around the issue, install DirectX 11.

You can check the version of DirectX by doing the following:

  1. Navigate to Start ► Run.
  2. Type dxdiag in the Open field.
  3. The System tab shows the DirectX version in the System Information area.

Note: The issue can occur either in an independent installation of the SAS add-in or in an installation of the add-in from SAS® Deployment Wizard. Upgrading to DirectX 11 resolves the issue in both installation scenarios.

Scenario 4: Anti-virus Software Might Block Necessary Files

Your anti-virus software might block the GTLManagedWindows.dll file or the Xceed.Zip.v5.1.dll file.

Here are some example default paths (your path could be different, depending on the version and bitness):

Add any folders where these files exist to the exclusion list within your anti-virus software settings.