Error Message during Excel application start up

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

Error Message during Excel application start up
Sometimes an add-in express error message box is shown during Excel application start up 
mio


Guest


Hi,

we developed an Excel Add-In and sometimes we get an error message during application start up (It is the default message box, when an unhandled exception occurs).
As I can see in the error message details, the Exception is not thrown in our user code, but in Add-In Express code (details below).

The problem occurs only on some application start ups and only on one specific machine. It does not matter if I opened an excel file or just start excel via start menu. This machine uses Office 2019 32Bit (Build: 16.0.11901.20070) and Windows 10, but other machines with the same Office version are not affected.


Detailed technical information follows:
---
Date and Time: 23.08.2019 10:50:23
Machine Name: LW-LENOVOO
IP Address: ::1
Current User:



Application Domain: C:\Program Files (x86)\Made in Office\empower charts\
Assembly Codebase: file:///C:/Program Files (x86)/Made in Office/empower charts/AddinExpress.MSO.2005.DLL
Assembly Full Name: AddinExpress.MSO.2005, Version=9.4.4644.0, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 9.4.4644.0



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



---- Stack Trace ----
AddinExpress.MSO.ADXAddinModule.SetHostApplication()
AddinExpress.MSO.2005.DLL: N 0938 (0x3AA) 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 0099 (0x63) IL


Best regards
Posted 26 Aug, 2019 04:11:39 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Fabian,

mio writes:
It does not matter if I opened an excel file or just start excel via start menu.


Check if there's an EXCEL.EXE hanging on the Details tab of the Task Manager window before you start Excel.


Andrei Smolin
Add-in Express Team Leader
Posted 26 Aug, 2019 04:38:29 Top
mio


Guest


Hi Andrei,

thank you for the quick answer.

What I currently know is that everytime we can reproduce this error, there was at least one more excel process running (multiple EXCEL.EXE in the Task-Manager details tab). Even if only one excel window was visible.

When we are talking about hanging excel processes. Is it possible that Addins prevent excel from shutdown (the process is still activ) or can this have another cause.

Best regards
Posted 26 Aug, 2019 05:21:13 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
what version of adxloader.dll and adxloader64.dll do you use?


Andrei Smolin
Add-in Express Team Leader
Posted 26 Aug, 2019 05:25:01 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
mio writes:
When we are talking about hanging excel processes. Is it possible that Addins prevent excel from shutdown (the process is still activ) or can this have another cause.


There's an add-in that prevents Excel from unloading. It may be your add-in or some other add-in.


Andrei Smolin
Add-in Express Team Leader
Posted 26 Aug, 2019 05:26:36 Top
mio


Guest


We are using version 9.4.4644 of adxloader.dll.
Posted 26 Aug, 2019 05:34:26 Top
mio


Guest


Hi Andrei,

it should be our Add-In that prevent Excel from shutdown (cause it is almost the only addin installed) and we can analyse why it behaves like it does. Do you might have a clue what can cause processes remaining after Excel closes? If I understand you correctly this should fix the problem that this internal exception occure. Do I?

But I dont want to show any internal error to the user directly (or show it on a diffrent kind). Is there a option to achieve this?
Posted 27 Aug, 2019 02:40:58 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Fabian,

I suppose, in this or that moment the user runs Excel via Automation. Say, there's some software product installed on that machine that starts Excel programmatically; typically, Excel is started invisible. If your add-in doesn't release COM objects, Excel will hang in processes. Note that a way to start Excel programmatically is to preview a workbook in a Windows Explorer window or edit an Excel worksheet embedded in a Word document; in this case Excel is started behind the scenes; check the processes list.

If Excel is started programmatically, ExcelApp.UserControl is false; see https://docs.microsoft.com/en-us/office/vba/api/excel.application.usercontrol. In this case, your Ribbons should be invisible, events disconnected, panes prevented from being shown. In our practice, if UserControl is true, we also call IsWindowVisible(ExcelApp.Hwnd): if this method returns false, we don't let event handlers execute.

[DllImport("user32.dll")]
public static extern bool IsWindowVisible(IntPtr hWnd);


Hopefully, the above will let you solve the issue. Still, I suggest that you study the actions that the user carries out for this issue to occur; this may bring more useful info.


Andrei Smolin
Add-in Express Team Leader
Posted 27 Aug, 2019 03:52:32 Top
mio


Guest


Hi Andrei,

thank you for your advice. I will check this and try to figure out more exactly what the user does.
Posted 28 Aug, 2019 01:58:15 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Fabian,

Please keep me notified.


Andrei Smolin
Add-in Express Team Leader
Posted 28 Aug, 2019 03:27:01 Top