Exception Message: Unknown application. in Word.

Add-in Express™ Support Service
That's what is more important than anything else

Exception Message: Unknown application. in Word.
An exception message is raised when starting word 
Pino Carafa




Posts: 162
Joined: 2016-09-28
AddinExpress.MSO.2005, Version=9.5.4661.0, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 9.5.4661.0

Exception Source: AddinExpress.MSO.2005
Exception Type: System.ArgumentException
Exception Message: Unknown application.
Parameter name: name
Exception Target Site: SetHostApplication


---- Stack Trace ----
AddinExpress.MSO.ADXAddinModule.SetHostApplication()
AddinExpress.MSO.2005.DLL: N 0000 (0x0) IL
AddinExpress.MSO.ADXAddinModule.AddinExpress.MSO.IDTExtensibility2.OnConnection(application As Object, connectMode As ext_ConnectMode, addInInst As Object, custom As Array&)
AddinExpress.MSO.2005.DLL: N 0105 (0x69) IL


I have found a few topics on this already, but they all seem to be happening for Excel. In this case it happens when the user launches Word.

Any suggestion on what I can do? In the Excel issues I see you're asking people to check whether there are Excel processes running already. I asked our Support person who is dealing with the issue to check for WINWORD.EXE processes that are already running but they insist that there aren't any.
Posted 17 Feb, 2022 07:01:05 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
The plot thickens....

We created a single Add-in to handle Word, Excel and Powerpoint

In Word it is throwing the error I mentioned in the original post.
In Excel, the addin appears to be working normally. My colleague in Support didn't check PowerPoint.
Posted 17 Feb, 2022 07:39:01 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
I'm doing a bit more searching and I find:
https://www.add-in-express.com/forum/read.php?FID=5&TID=2198

In our case the error happens as soon as the user starts Word so I'm not sure there is anything we can do from within the add-in itself but ... I would imagine the OutlookApp.Name (or in our case a WordApp, perhaps?) would get its value from a registry setting? Would we be able to check this in the Registry? If so.... where?
Posted 17 Feb, 2022 07:49:45 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Pino,

How do I reproduce this issue? Does the issue occurs after you restart the machine?

Regards from Poland (CET),

Andrei Smolin
Add-in Express Team Leader
Posted 17 Feb, 2022 09:37:16 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
I don't know, Andrei.... This add-in is installed on hundreds of machines and this is the only one that has this problem ... I will ask my colleague in support to provide those details. Also, I'm paraphrasing Sergey's request in https://www.add-in-express.com/forum/read.php?FID=5&TID=2198 and I have asked her "what localization does Word have on the PC? Is it English or something else?"
Posted 17 Feb, 2022 10:16:15 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Pino,

1. Maybe, they have something of value in their Event Viewer?
2. Try to turn all other add-ins off.
3. Make sure Word is started normally, not programmatically. Also, check the Processes tab of the Task Manager window: WINWORD.EXE should be started from the user account of that user, not from some other user account.
4. Is Office updated? Is that Office build very old?
5. Get a recent adxloader.log from their machine. If adxregistrator.log is available, provide it as well. Send the log(s) to our support email address.

Regards from Poland (CET),

Andrei Smolin
Add-in Express Team Leader
Posted 17 Feb, 2022 10:28:09 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
Thanks Andrei, I will try and get you that information tomorrow.
Posted 17 Feb, 2022 10:34:50 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
Ok in both issues - this one 16315 and the other one 16316 - I am not finding anything about any errors in the adxloader.log file. Now I'm starting to wonder whether that's caused by us handling the errors:


    Private Sub AddinModule_OnError(e As ADXErrorEventArgs) Handles Me.OnError
        Try
            Dim sError As String
            If Not e Is Nothing Then
                If Not e.ADXError Is Nothing Then
                    sError = e.ADXError.HResult.ToString + ": " + e.ADXError.Message
                    If Not e.ADXError.InnerException Is Nothing Then
                        Try
                            sError = sError + vbCrLf + "  Inner Exception" + e.ADXError.InnerException.HResult.ToString + " - " + e.ADXError.InnerException.Message
                        Catch

                        End Try
                    End If
                    If Not String.IsNullOrEmpty(e.ADXError.StackTrace) Then
                        sError = sError + vbCrLf + "Stack Trace:" + vbCrLf + e.ADXError.StackTrace
                    End If
                    Clipboard.SetText(sError)
                    e.Handled = True
                    MsgBox("Add-in Express encountered an error while loading the add-in" + vbCrLf + vbCrLf + "This may be a non-fatal error and you may be able to continue working" + vbCrLf + vbCrLf + "The text of the error has been copied to your clipboard" + vbCrLf + "PLEASE NOTE: DO NOT take a SCREEN SHOT of this message. The information we need has already been copied, and all you need to do is paste it into an Email, a Word document or another text editor." + vbCrLf + vbCrLf + "Once you have pasted the information, click OK to try to continue", vbInformation Or vbOKOnly, "An error occurred")
                End If
            End If
        Catch

        End Try
    End Sub


As you can see we set e.Handled = True so could it be that by us doing so we stop it from logging the error in adxloader.log ? In that case we will need to give user a version without handling the error for debugging. We do get to see the Msgbox.
Posted 17 Feb, 2022 13:04:23 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello Pino,

Pino Carafa writes:
could it be that by us doing so we stop it from logging the error in adxloader.log ?


No. adxloader works when your add-in is being loaded by Office and adxloader.log may only list load-time errors.

If you set e.Handled = false, Add-in Express shows an error message form, so setting r.Handled = true and showing a message box - as you do - is correct.

Check if your add-in is being unloaded when this occurs: it might receive AddinBeginShutdown; see the add-in module. Or, maybe Word raises the Quit event?

Regards from Poland (CET),

Andrei Smolin
Add-in Express Team Leader
Posted 18 Feb, 2022 05:16:06 Top
Pino Carafa




Posts: 162
Joined: 2016-09-28
I'll keep an eye out for those. So far this has only happened once.
Posted 03 Mar, 2022 04:33:07 Top