cancel
Showing results for 
Search instead for 
Did you mean: 

Could not load file or assembly "Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" or one of its dependencies. The system can not find the file specified.

Pradeep_Verma
Champ on-the-rise
Champ on-the-rise

Hi,

I am using Onbase 13. I have got Microsoft.Office.Interop.Excel.dll  Version=15.0.0.0 available in System Assemblies in Director Studio. So I have added reference of the same in my unity script. The bulid gets successful. However on executing the script, I am getting the following error:

Could not load file or assembly "Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" or one of its dependencies. The system can not find the file specified.

Please help.

Thanks,

Pradeep

1 ACCEPTED ANSWER

Scott_McLean
Elite Collaborator
Elite Collaborator

Hi Pradeep,

First, the MS party-line on this:
MS does not support the automated use of the Office Interop DLLs and instead recommends using the OpenXML API.

That said, it's possible, but you need to know all the risks and gotchas. This is not specific to OnBase. Any automation using these APIs will require similar steps.

When you are using the Office Interop (COM) API DLLs, they can only be executed on a machine where MS Office (32-bit) is installed. The installation must also include the PIAs (Primary Interop Assemblies). Unlike the newer OpenXML API, the older Interop DLLs use the Office applications behind the scenes and will fail to load in their absence. Assuming this is a server-side script, you will need MS Office installed on the Application Server and any Workflow Timer Server(s) that execute this script.

Additionally, you may need to modify the AppServer application pool and any workflow timer services to run as an account that is a local administrator on the machine where the script is executing. You will want to log in as this account and run the Office programs at least once to get past any setup dialogs.

Lastly, although this sounds weird, Office uses predetermined scratch locations, so you need to create the following directories:

  • C:\Windows\System32\config\systemprofile\Desktop
  • C:\Windows\SysWOW64\config\systemprofile\Desktop

I hope that helps move you toward a solution.

Happy coding,

-Scott

View answer in original post

1 REPLY 1

Scott_McLean
Elite Collaborator
Elite Collaborator

Hi Pradeep,

First, the MS party-line on this:
MS does not support the automated use of the Office Interop DLLs and instead recommends using the OpenXML API.

That said, it's possible, but you need to know all the risks and gotchas. This is not specific to OnBase. Any automation using these APIs will require similar steps.

When you are using the Office Interop (COM) API DLLs, they can only be executed on a machine where MS Office (32-bit) is installed. The installation must also include the PIAs (Primary Interop Assemblies). Unlike the newer OpenXML API, the older Interop DLLs use the Office applications behind the scenes and will fail to load in their absence. Assuming this is a server-side script, you will need MS Office installed on the Application Server and any Workflow Timer Server(s) that execute this script.

Additionally, you may need to modify the AppServer application pool and any workflow timer services to run as an account that is a local administrator on the machine where the script is executing. You will want to log in as this account and run the Office programs at least once to get past any setup dialogs.

Lastly, although this sounds weird, Office uses predetermined scratch locations, so you need to create the following directories:

  • C:\Windows\System32\config\systemprofile\Desktop
  • C:\Windows\SysWOW64\config\systemprofile\Desktop

I hope that helps move you toward a solution.

Happy coding,

-Scott

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.