Suddenly the RTC stopped working at our client site… the app crashed when starting it was the initial support request we got. But asking further, the problems started a few days earlier, and not all at once for all computers.

The event log of a system where the app crashes has something like:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
   at Microsoft.Dynamics.Nav.Client.WinClientExcelExportService.FindMajorVersion(Microsoft.Win32.RegistryKey)
   at Microsoft.Dynamics.Nav.Client.WinClientExcelExportService.<.ctor>b__8_0(Microsoft.Win32.RegistryKey)
   at Microsoft.Dynamics.Nav.Client.WinClientExcelExportService.FindRegistryKey(Microsoft.Win32.RegistryHive, System.String, System.Action`1<Microsoft.Win32.RegistryKey>)
   at Microsoft.Dynamics.Nav.Client.WinClientExcelExportService.FindFirstRegistryKey(System.String, System.Action`1<Microsoft.Win32.RegistryKey>)
   at Microsoft.Dynamics.Nav.Client.WinClientExcelExportService..ctor(Microsoft.Dynamics.Framework.UI.UISession)
   at Microsoft.Dynamics.Nav.Client.WinClient.NavWinFormsClientSession+<>c.<AddServices>b__22_6(Microsoft.Dynamics.Framework.UI.UISession)
   at Microsoft.Dynamics.Framework.UI.ClientSessionCore.AddUIService(System.Func`2<Microsoft.Dynamics.Framework.UI.UISession,Microsoft.Dynamics.Framework.UI.IUIService>)
   at Microsoft.Dynamics.Nav.Client.WinClient.NavWinFormsClientSession.AddServices()
   at Microsoft.Dynamics.Framework.UI.ClientSessionCore.Prepare()
   at Microsoft.Dynamics.Nav.Client.WinClient.StartWinFormsClient.SetupClientSession()
   at Microsoft.Dynamics.Nav.Client.WinClient.StartWinFormsClient.RunCore()
   at Microsoft.Dynamics.Nav.Client.WinClient.StartWinFormsClient.Run(Boolean)
   at Microsoft.Dynamics.Nav.Client.Program.Main(System.String[])

The clue to the case is that it looks like the app is trying to find/read a registrykey concerning Microsoft Excel. Something goes wrong there and it crashes.

Examining the case, it looks like following registry entries are involved:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\exel.exe

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\excel.exe

And, what the heck, why are the values empty? This customer was using a office 365 subscription, and the installer was updating the computers at different times. But tt seams Office 365 online updater program deletes the contents of these keys, but not the keys it selves. And that is what the RTC app is not happy about. If the keys do not exist, it assumes excel is not there and continues. If the keys are there there they should be 4 values below:

Or, if exported as a registry file, it looks like:

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\excel.exe]
@=”C:\\Program Files\\Microsoft Office\\Root\\Office16\\EXCEL.EXE”
“Path”=”C:\\Program Files\\Microsoft Office\\Root\\Office16\\”
“UseURL”=”1”
“SaveURL”=”1”

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe]
@=”C:\\Program Files\\Microsoft Office\\Root\\Office16\\EXCEL.EXE”
“Path”=”C:\\Program Files\\Microsoft Office\\Root\\Office16\\”
“UseURL”=”1”
“SaveURL”=”1”

You can download my file below. Remove the .text extension, renaming it to .reg effectually, if you agree with it’s content.
Please inspect the file before renaming.

You thus have 2 options to be able to run the RTC again:

  • Remove the excel key in total
  • Add the data manually again, or by importing a previously saved registry script

There seems to be a problem though.
Every time the office 365 updater fires again for installing a new version of office, the same problem of deleting the key values can occur again. And it’s not known currently if this will be considered an office problem, which will be fixed by changing/removing the key, or considered a fault in Nav/Business Central, and needs to be fixed by a cummulative update.