Не удается создать указанный элемент ActiveX

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

Не удается создать указанный элемент ActiveX
 
Javlon Juraev




Posts: 6
Joined: 2020-10-26
Доброго времени суток,

Я почти в отчаянии пытаясь выяснить причину проблемы.

У некоторых моих пользователей выходит вот такая ошибка при выполнении функции которая открывает боковую панель:

Exception Source:
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: Не удается создать указанный элемент ActiveX.
Exception Target Site: ForwardCallToInvokeMember

Я прочитал все темы в форуме об этом, испытал все решения - не могу понять в чём дело. Где-то говориться это из-за ошибки в обновлении Net Framework. Но это было в 2018 году - как это всё ещё может быть причиной?

У некоторых при изменении UAC настроек всё работает, некоторым и это не помогает. Я не могу воспроизвести ошибку у себя на компьютере - так как не знаю из-за чего она происходит. По моему, проблема всё же в UAC. Ошибка возникает если у пользователя выключен UAC.

Как же мне сделать так чтобы надстройка работала независимо от настроек UAC? Я не могу постоянно просить пользователя менять настройки UAC, особенно неопытного пользователя.

Вот мой AddinModule.cs:

[code removed as requested]

Прошу прощения что вставляю весь код - боясь что-то пропустить.
Posted 14 Feb, 2021 08:49:52 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Javlon,

Although we do understand Russian, this is an English-language forum. Our goal is to let our customers find your issue using English keywords.

So, you have the "unable to create specified ActiveX control" exception when creating your Custom Task Pane (not an Add-in Express Word Task Pane).

First off, make sure your ADXTaskPane component specifies the correct type name in the ControlProgId property: a typical mistake is to leave this property unchanged after you rename the User Control and/or the project namespace.

Secondly, make sure your code doesn't produce an exception when the task pane instance is being created. A typical way to get such an exception would be to initialize a complex-type variable declared on the class level of the UserControl component. I suggest that you initialize such variables in an event of the UserControl component.


Andrei Smolin
Add-in Express Team Leader
Posted 15 Feb, 2021 04:24:54 Top
Javlon Juraev




Posts: 6
Joined: 2020-10-26
Hi,

Sorry for the post in Russian.

Can I edit or remove my forum post above? I have posted my code and I wouldn't want it to be publicly available.

Thanks.

JJ
Posted 15 Feb, 2021 12:05:49 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello JJ,

No problem.

I assume you can modify that message in any way you need. If this isn't so, I'll ask our guys to remove the code.


Andrei Smolin
Add-in Express Team Leader
Posted 16 Feb, 2021 09:07:33 Top
Javlon Juraev




Posts: 6
Joined: 2020-10-26
Hi,

There is no edit option for a message. So, please, remove the code block in my initial message.

Best,

JJ
Posted 02 Mar, 2021 08:53:05 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Done.


Andrei Smolin
Add-in Express Team Leader
Posted 03 Mar, 2021 04:54:45 Top