Microsoft.Office.Interop.Excel cannot be found on system when using PowerPoint

IvoG 1 Reputation point
2021-04-22T11:33:05.837+00:00

Hello,

I have an application which uses the Microsoft.Office.Interop assemblies. On a couple of machines, for some reason when my application is running and PowerPoint is started, on the users end, they can't click on any dropdowns. My applications throws this exception:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'

I am using the Microsoft.Office.Interop assemblies from NuGet.

Looking at the Fusion logs I found that PowerPoint is searching for Microsoft.Office.Interop.Excel not in their usual path (like on my machine): C:\WINDOWS\assembly\GAC_MSIL\Policy.14.0.Microsoft.Office.Interop.Excel\15.0.0.0__71e9bce111e9429c\Policy.14.0.Microsoft.Office.Interop.Excel.config, but inside C:\Program Files\WindowsApps\Microsoft.Office.Desktop_16040.11001.20108.0_x86__8wekyb3d8bbwe\VFS\Windows\assembly\GAC_MSIL\Policy.14.0.Microsoft.Offic.

*** Assembly Binder Log Entry  (3/13/2021 @ 11:32:55 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Program Files\MyApp\app.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/MyApp/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = app.exe
Calling assembly : app, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\MyApp\file.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Publisher policy file is found at **C:\Program Files\WindowsApps\Microsoft.Office.Desktop_16040.11001.20108.0_x86__8wekyb3d8bbwe\VFS\Windows\assembly\GAC_MSIL\Policy.14.0.Microsoft.Offic.**
WRN: Error parsing XML file **C:\Program Files\WindowsApps\Microsoft.Office.Desktop_16040.11001.20108.0_x86__8wekyb3d8bbwe\VFS\Windows\assembly\GAC_MSIL\Policy.14.0.Microsoft.Offic.** Ignoring.
LOG: Post-policy reference: Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/MyApp/Microsoft.Office.Interop.Excel.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/MyApp/Microsoft.Office.Interop.Excel/Microsoft.Office.Interop.Excel.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/MyApp/Microsoft.Office.Interop.Excel.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/MyApp/Microsoft.Office.Interop.Excel/Microsoft.Office.Interop.Excel.EXE.
LOG: All probing URLs attempted and failed.

The issue is happening on Microsoft PowerPoint 2016 MSO 32-bit. I guess this is the Office 365 click-to-run version of PowerPoint.
The users have Microsoft.Office.Interop.Excel.dll in there GAC.
Starting PowerPoint as Admin, resolves the issue.
My question is if this PowerPoint version is not supporting the usage of PIA or this PowerPoint version maybe corrupting the permissions on the Interop assemblies in the GAC?

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,936 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Oskar Shon 866 Reputation points
    2024-09-18T19:51:40.1766667+00:00

    If you run: MyApp\app.exe and use Excel control, you should have:

    A. MS office on this commuter with active license

    B. The same version office as it use in project

    User's image or in parameters set "Any version" knowing that old has a limit.

    I see: Version=14.0.0.0, in your comment so that is a MSO-2010 so that could be work only with it. If that is not your project/application, contact with developer

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.