Categories
Dynamics NAV Microsoft Office

A call to Microsoft.Dynamics.Nav.OpenXml.Spreadsheet.WorkbookWriter.Create failed

I was using the function Export to Excel from the Config. Package Card in Microsoft Dynamics NAV 2017 when I’ve received the following error message:

A call to Microsoft.Dynamics.Nav.OpenXml.Spreadsheet.WorkbookWriter.Create failed with this message:
Could not load file or assembly ‘DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

A call to Microsoft.Dynamics.Nav.OpenXml.Spreadsheet.WorkbookWriter.Create failed with this message:
Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Cause:
Probably Open XML SDK 2.5 for Microsoft Office has not been installed on your computer.

Solution:
Close Excel.
Install Open XML SDK 2.5 for Microsoft Office from Microsoft Dynamics NAV DVD, the installation file is under

Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\

Restart NAV Service after the installation.

Did my solution solve your problem? Leave a reply.

Categories
Dynamics NAV Microsoft

the process may not have access rights for the private key

I’m changing a NAV Instance to use a new certificate but the service fails to run, looking at the Event Viewer I can find the following error message:
The service <ServiceName> failed to start. This could be caused by a configuration error. Detailed error information: System.ArgumentException: It is likely that certificate ‘<CertificateSubject>’ may not have a private key that is capable of key exchange or the process may not have access rights for the private key.

Solution:
Run MMC, click on File -> Add/Remove Snap-in…, then add Certificates, selecting Computer Account and Local Computer
NOTE: Identify the relevant certificate and verify that a small yellow key is shown in the icon, if not it means you don’t have the private key for this certificate so you need to import the certificate with the Private Key.
Right-click on the certificate then select All Tasks -> Manage Private Keys
Click Add in the permissions window
Add the Service Account that run the NAV Service (in my case it was “Network Service”).

Did my solution solve your problem? Leave a reply.