Не загружается надстройка excel

Хитрости »

8 Сентябрь 2016              41064 просмотров


Microsoft уже радовал нас обновлениями безопасности, приводящими к неработе определенного функционала. Эпопея продолжается: на этот раз нас решили обезопасить от надстроек. После июльского обновления безопасности офиса большинство подключенных ранее надстроек(типа .xlam и .xla) просто перестало включаться. Т.е. при запуске Excel как установленные ранее надстройки, так и новые тупо не включались. Без всяких предупреждений и сообщений. Многие грешили на надстройки и их авторов, а дело-то обстоит иначе. Просто в этом обновлении добавили запрет на запуск небезопасного содержимого из надстроек, не отмеченных как надежные. Поэтому если в какой-то момент надстройка перестала запускаться без видимых причин или скачали откуда-то надстройку(да прямо с этого же сайта) и она не запускается, то попробуйте один из следующих вариантов:

Вариант 1
Отключить в Excel защищенный просмотр для файлов из Интернета
Файл(File)Параметры(Options)Центр управления безопасностью (Trust Centr)Параметры центра управления безопасностью (Trust Centr Settings)Защищенный просмотр(Protected View) -снять флажок с Включить защищенный просмотр для для файлов из Интернета(Enable Protected View for files originating from the Internet)
Надо понимать, что сработает только если надстройки были скачаны с интернета. Хотя обновление безопасности итак только для таких файлов запрет ставит.

Вариант 2
Добавить папку с нужной надстройкой/надстройками в Надежные расположения
Файл (File)Параметры(Options)Центр управления безопасностью (Trust Centr)Параметры центра управления безопасностью (Trust Centr Settings)Надежные расположения(Trusted Locations)Добавить новое расположение(Add new location). В диалоговом окне выбрать папку, в которой хранится файл надстройки. Можно поставить галочку Так же доверять всем вложенным папкам(Subfolders of this location are also trusted), если это необходимо(например, если у вас одна папка с надстройками, но надстройки поделены на категории и каждая в своей подпапке).
Надежные расположения
Убедиться, что галочка Отключить все надежные расположения отключена(Disable All Trusted Locations).
Эти два варианта не рекомендуется самим Microsoft, т.к. потенциально снижают безопасность. Хотя для второго пункта очевидно, что надо просто не кидать в надежные расположения все файлы подряд.

Вариант 3
Разблокировать файл

  1. полностью закрыть Excel(все файлы и приложение целиком)
  2. перейти в папку с нужной надстройкой и найти там файл надстройки
  3. правая кнопка мыши по файлу —Свойства. На вкладке Общие нажать кнопку Разблокировать(так же это может быть флажок блокировки — тогда его надо снять)
    Разблокировать
  4. нажать кнопку ПрименитьOK

Проделать действие со всеми нужными файлами надстроек.

Вариант 4
Небольшой финт, за который отдельное спасибо Захарову Владимиру, известному на форумах под ником ZVI

  1. полностью закрыть Excel(все файлы и приложение целиком)
  2. перейти в папку с нужной надстройкой и найти там файл надстройки
  3. запаковать в ZIP или RAR архив файл надстройки, удалить саму надстройку и затем извлечь из архива файл надстройки обратно в ту же папку

Вариант 5
Еще один финт, за который опять же спасибо Захарову Владимиру(ZVI)

  1. полностью закрыть Excel(все файлы и приложение целиком)
  2. перейти в папку с нужной надстройкой и найти там файл надстройки
  3. скопировать файл надстройки на флешку с файловой системой FAT32, затем скопировать с флешки обратно

Статья помогла? Поделись ссылкой с друзьями!

  Плейлист   Видеоуроки


Поиск по меткам



Access
apple watch
Multex
Power Query и Power BI
VBA управление кодами
Бесплатные надстройки
Дата и время
Записки
ИП
Надстройки
Печать
Политика Конфиденциальности
Почта
Программы
Работа с приложениями
Разработка приложений
Росстат
Тренинги и вебинары
Финансовые
Форматирование
Функции Excel
акции MulTEx
ссылки
статистика

Есть несколько причин, по которым панель инструментов может не появиться в Excel на вкладке НАДСТРОЙКИ

Причина: вы забыли разблокировать надстройку после скачивания с сайта

Когда может случиться: при первом запуске скачанной надстройки

Решение проблемы: перед запуском скачанного файла надстройки, необходимо:

  • найти скачанный файл надстройки в папке (обычно это папка «Загрузки»)
  • щелкнуть правой кнопкой мыши на файле — Свойства — ставим галочку Разблокировать ОК
  • и только после этого запускать

Это связано с недавним изменением политики безопасности в приложениях Office (скачанные из интернета файлы с макросами, не будучи предварительно разблокированными, запускаются без макросов)

Причина: антивирус повредил файл надстройки при проверке

ЭТО НАИБОЛЕЕ ЧАСТО ВСТРЕЧАЮЩАЯСЯ ПРОБЛЕМА В 2018 — 2020 ГОДАХ
Даже если вам кажется, что у вас нет антивируса, наверняка он есть, — например, встроенный в систему Защитник Windows (он же Windows Defender)

Когда может случиться: в любой момент. чаще всего, это происходит при скачивании файла с сайта

Решение проблемы: надо добавить мой сайт ExcelVBA.ru и расширение файла .xla в список исключений антивируса,
после чего заново скачать надстройку с сайта.

ПОДРОБНАЯ ИНСТРУКЦИЯ ПО РЕШЕНИЮ ПРОБЛЕМ С АНТИВИРУСОМ

ВАЖНО: убедитесь, что антивирус никак не реагирует на скачивание и запуск надстройки.
Если какое-то предупреждение от антивируса выскочило — с вероятностью 90%, антивирус повредил файл надстройки, и надстройка не запустится.

Причина: в настройках безопасности Excel заданы ограничения

Когда может случиться: в новых версиях Office такое иногда имеет место быть

Решение проблемы: нажимаем в меню Excel —  — , и потом справа кнопку .
В появившемся окне в левом столбце есть пункты и .
По очереди заходим в каждый из этих разделов, и ставим галочки «Отключить все надёжные расположения» и «Отключить надёжные документы».
Теперь закрываем Excel, и пробуем снова запустить надстройку.
После этого Excel не будет считать надстройку ненадежной, только потому что она расположена не в той папке.

Причинанадстройка не запустилась вместе с Excel

Когда может случиться: при повторных запусках (когда до этого всё работало)

Решение проблемы: убедитесь, что надстройка запущена. Для этого, найдите файл надстройки в папке, и запустите его двойным щелчком.
Если надстройка запускается автоматически (включена опция автозапуска в — ), убедитесь, что вы не перемещали и не переименовывали файл надстройки.

Причина: макросы в Excel отключены
Excel отключает все макросы во всех файлах, — иногда с уведомлением, а иногда и без него.

Когда может случиться: при первом запуске скачанной надстройки
Встречается редко. По умолчению, макросы отключены «с уведомлением», т.е. Excel спрашивает, нужно ли включить макросы для каждого запускаемого файла с макросами. Но даже когда вы нажимаете кнопку «Включить макросы» в этом уведомлении, то следом может появиться окно типа «Обнаружены вредоносные макросы», и надстройка не запустится.

Решение проблемы: нужно включить макросы в Excel
Нажимаем в меню Excel —  — , и потом справа кнопку .
В появившемся окне в левом столбце выбираем пункт , и справа выбираем опцию «Включить все макросы»

Introduction

So you have deployed your awesome Excel addin in production and all is working fine for some weeks: you are enjoying your success …
But one day the phone rings and the guy at the other side is not really happy; no, he is completely upset and you could almost smell his breath when he screams.
But why? Because your awesome addin has stopped working on his workstation without notice.

Sometimes the root-cause is obvious: you have delivered a new version, but in many cases you will hardly ever know the root-cause of this annoying situation: Windows update, Office update, quick and dirty moving/installation of the addin from a workstation to another one, bad alignment of Uranus and Jupiter… 

A wealth of errors can happen, then it’s hard to have them all in mind, especially when you are in a hurry and with stress you start to get mixed up. So to be as efficient as possible you’d better have a checklist and this is precisely what this article will be, enumerating all the errors I have encountered describing usual causes and solutions. 

So let’s troubleshoot! 

0) The magic solution that works almost 50% of the time

If the error message does not inspire you and you want or need to move fast, you can try this as a first shot:

  1. Go into the VBA editor (ALT-F11 is a handy shortcut).
  2. In the top menu, choose «Tools» then «References«:

    VBA Tools References

    VBA Tools References

    You should see this popup:

    vba_references_popup

    The reference can point to an XLA file or a TLB file (which is the interface of your addin used
    by VBA).

  3. Locate your addin reference (if selected it should be at the top), uncheck it and click «OK«.
  4. Reopen this popup, locate your addin (you can type its first letter to directly go to the first addin whose name starts with this letter) but this time recheck it.
  5. Restart the operation that was broken and cross your fingers, it may be OK now.
  6. Still sucks? Follow the rest of this guide depending on your error.

I’ve seen the unreference/re-reference trick working for:

  • Error 430 «class does not support automation or does not support expected interface» :

    VBA Error 430

    VBA Error 430

    which is typically the consequence of an update of your add-in API like changing the signature of a method.

  • «Out of memory» errors:

    VBA Out of memory error

    VBA Out of memory error

  • And a bunch of other situations…

If your Excel application is made of normal spreadsheets (XLS, XLSM…) and XLAs, do not forget to update the references for all the files referencing your addin, not just the spreadsheets.

1) Excel is crashing before you can try the magic solution

Sometimes you’re really not in luck and while you feel that a simple «unreference/rereference» could do the job Excel does not give you the opportunity to try it as it crashes before you can access the VBA editor.

This issue can occur if the workbook is referencing the absolute path to the TLB on your development environment and you deploy the workbook as is in your production environment where the TLB will probably be in another place (typically a sub-directory of «Program Files»).
It can also occurs if you have multiple versions of your addin on the workstation.
It can often happens on your development workstation if:

  • you develop with multiple workspaces (one for each of your SVN/Git branches) and there is a mix between the different TLBs and addins : you can try a full cleanup (including Windows registry) and rebuild from the workspace you’re currently working on
  • you use a task manager or integration server like Jenkins (ex Hudson) which builds your addin and register it into the system in your back : you can temporarily disable the task that breaks your setup

If the workbook is broken in production, you can use two solutions :

  1. Start Excel in safe-mode, either by starting it from the «Run» popup (shortcut is Windows-R) with the «/safemode» option :

    Run Excel in safe-mode

    Run Excel in safe-mode

    or by pressing continuously the CTRL key while starting it which should trigger the following popup :

    Excel start safemode

    Excel start safemode.

    Once Excel is started in safe-mode load the broken workbook. You should be able to access the «References» popup and do the unreference/rereference trick.

  2. You can temporarily move or rename the TLB file and starts your Excel application as usual. Excel should not crash anymore and starts as usual, only complaining about the missing TLB. You can now move/rename the TLB as it was before, proceed to the «unreference/rereference» trick and then save the workbook to ensure the correct reference is kept. All should be fine at the next startup.

2) «Error in loading DLL» when referencing a TLB

If, when referencing a TLB, you see this popup :

VBA Error in loading DLL

VBA Error in loading DLL

this is probably the sign that Excel cannot access the TLB file, the root cause can be :

  • a simple installation issue : the TLB not being where it is expected (you can check the expected path in the Windows registry using RegEdit); so check the correct installation of your application and reinstall it if necessary.
  • user rights issue with the TLB, and more generally all the installation items : this can happen if you have installed your application with a user that is not the one currently trying to use the application (e.g. a remote user).
    You can then either:

    • proceed to a dedicated reinstallation for the current user,
    • change the rights of the installation items to allow him full access,
    • or add him to a user-group that has the required rights,

    whichever you find easier and cleaner in your situation.

3) «Error in loading DLL» when compiling the VBA project

If this error occurs when the VBA code is compiled, either automatically when accessing a function/sub that uses the addin API or manually when clicking the Debug/Compile menu item then check if you have recently changed the settings of a dependency (e.g. of your .Net (C#, VB.Net…) project) that contains COM types you expose through your addin API.

I’ve seen this issue once in a C# project with the ADODB dll when the «Embed Interop Types» option was set to «True» in the reference properties. With only this settings and «Copy Local» to «False» a method of the addin that returned an ADODB connection was broken in Excel 2003 on Windows XP whereas all was working fine on Excel 2010 on Windows 7. I’ve not dived into the details but it seems the «Embed Interop Types» feature is not retro-compatible or may need some additional setup on the workstation, which in both case made it unusable.

So, setting «Embed Interop Types» to «False» and reverting «Copy Local» to «True» solved the issue caused by Visual Studio 2010 because it activates these settings by default with .NET 4.0 projects (the project had recently been migrated from .Net 3.5 to .Net 4.0)!

ADOBD Reference Properties

ADOBD Reference Properties

As often VS wanted to help but broke something
<img src= » class=»wp-smiley» />

4) The addin does not want to load

If you can see your addin in the «COM Addins» list and you can check it :

COM addin checked

COM addin checked

but when you reopen the «COM Addins» popup your addin is not checked anymore, it’s the sign Excel cannot or does not want to load the addin.

If your addin throws an exception when loaded, ie in the «OnConnection» method, you should see a warning at the bottom of your addin description, in the «Load Behavior» field :

Excel COM addin error

Excel COM addin error

You can reproduce this behavior with a simple code :

public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
{
    applicationObject = application;
    addInInstance = addInInst;

    throw new Exception("Boom!");
}

But if your addin causes more serious damages like an Excel crash, what you can experiment with such a code :

public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
{
    applicationObject = application;
    addInInstance = addInInst;

    System.Diagnostics.Process.GetCurrentProcess().Kill();
}

then Excel won’t trust it anymore and may put in quarantine ALL the addins loaded at the time of the crash!
If you are lucky you should see this message at the next startup of Excel :

Excel addin serious problem

Excel addin serious problem

You can choose to give your addin a second chance by answering «No» or you can answer «Yes» so the addin will stay disabled and you won’t be able to load it into Excel until you notify Excel the addin should not be kept in quarantine any longer.

But if you are in doubt and think your addin may have been disabled how to check ?
You have at least two solutions :

  •  using Excel 2010 : go to the «File» ribbon tab then «Options» :

    Excel2010 File Options

    Excel2010 File Options

    You should see the «Excel Options» popup in which you now select «Add-Ins» :

    Image 14

    Excel 2010 Options Add-Ins

    From here scroll down to the bottom of the list where the disabled items are listed.
    Here is an example of a too zealous Excel that has disabled all the COM addins (and they were a lot!) :

    Image 15

    Excel2010 Disabled addins

    To show the culprit of all this mess use the «Manage» drop-down at the bottom of the window and choose «Disabled Items» :

    Image 16

    Excel 2010 Go To Disabled

    then click the «Go…» button to show the bad guy :

    Excel 2010 Culprit Addin

    Excel 2010 Culprit Addin

    If you forgive your addin then select it and click «Enable» then «Close» :

    Excel 2010 Addin Reenable

    Excel 2010 Addin Reenable

    You should now be able to reload it and all the other addins disabled due to the crash via the «COM Add-Ins» popup.

  • using the Windows registry : Excel stores the disabled items list into the registry under the keys «…SoftwareMicrosoftOffice14.0ExcelResiliencyDisabledItems«, e.g. «HKEY_CURRENT_USERSoftwareMicrosoftOffice14.0ExcelResiliencyDisabledItems«. If an addin has been disabled you’ll find a binary key holding its name :

    Image 19

    RegEdit DisabledItems Key

    We can read the identity of our explosive addin : «boomaddin».
    If you want to reenable it you can either:

    • delete the numerical entry (here «5793E01E»)
    • delete the whole «DisabledItems» key

    Note that this change will be effective only for the next Excel instances, so you’ll have to restart your application to be able to load your addin as usual.

5) NullReferenceException thrown by the .Net (C#, VB.Net…) addin code

«Object not set to an instance of an object» like errors generally happen when your .Net addin has not been loaded by Excel, so initialization code has not been executed (typically the part that captures the Excel application instance loading the addin).
Therefore your addin code may be naively accessing not initialized references.

Indeed you’ll typically use code like this one :

public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
{
    
    applicationObject = application;
    addInInstance = addInInst;

    
}

public void DoSomething()
{
    
    (applicationObject as Application).ActiveCell.Value2 = "Something";
}

If the addin is not loaded the «OnConnection» method will not be called, then the «applicationObject» reference will not be initialized with the running Excel instance.

It could also happen that something is broken inside the «OnConnection» method itself preventing it from running to its end, letting the addin half-initialized (which is far more dangerous than not initialized at all as the resulting errors and behavior will be more surprising and entertaining
;) ).
So you should always keep track of your addin state and notify of any inconsistency : using a simple boolean flag set to «true» at the end of initialization (typically at the end of the «OnConnection» method) should be sufficient in most cases.

So refer to point 4) to check the status of your addin.

6) Generic run-time error

Sometimes you get this kind of anonymous error popup :

Excel Automation error

Excel Automation error

To make sense of this cryptic and apparently useless message you should lookup your error-code/HRESULT (here 80131524) in this list.

In this case the error was COR_E_DLLNOTFOUND due to a missing native DLL used through DllImport by the C# addin (itself called by a VBA macro).

Deployment of native DLLs often causes issues that you can troubleshoot using Dependency Walker (see my article about it).

7) All other unknown mystic errors

If you have any error not referenced here, for which you don’t find a solution by googling it and whose root-cause is impenetrable then, in desperation, you can try to remove any trace of your addin in your system : 

  • remove all the files and directories that contain the assets of your application like XLS/XLSX/XLSM spreadsheets (whose references could have been corrupted), DLLs and TLBs
  • cleanup the registry by hand by looking for all the references to your addin : DLLs and TLBs keys should be enough but you can also remove all the COM registration information of your types.

Then reinstall the addin and cross your fingers…

It should be relatively uncommon to need this : in the last year I’ve never had to go this far thanks to my better understanding of Excel addins and this kind of checklist.

Conclusion 

If this article has helped you troubleshoot an issue I’d like to read your story.

If you have any remarks or suggestions about this article or if you know other errors with their standard fixes please share by letting a comment, I’ll do my best to update this article with your feedback.

2 / 2 / 1

Регистрация: 21.06.2014

Сообщений: 108

1

20.09.2014, 16:05. Показов 18695. Ответов 4


Студворк — интернет-сервис помощи студентам

Запускаю от имени администратора, ставлю галочку на включение (статус поведение при загрузке не меняется. остается «выгружен», нажимаю ОК
окошко закрывается, но надстройка не включена
если зайти туда же, то там будет снята галочка
надстройка называется MySQL for Excel



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

20.09.2014, 16:05

Ответы с готовыми решениями:

Надстройки для Excel
Почему при подключении надстройки VSTO появляется ошибка, где указан путь к файлу и написано &quot;не…

Надстройки для Excel
Здравствуйте! столкнулась с такой проблемой, что при запуске надстройки, созданной в Visual Studio,…

Редактирование надстройки EXCEL
Ситуация: есть файл start.xla (при запуске сам не показывается, а формирует и запускает временный…

Добавление надстройки Excel в Ribbon
Здравствуйте.
Написал я две надстройки на VBA для Excel, и захотелось мне поместить две кнопки для…

4

5942 / 3154 / 698

Регистрация: 23.11.2010

Сообщений: 10,524

20.09.2014, 17:07

2

В Параметрах не пробовали?



0



2 / 2 / 1

Регистрация: 21.06.2014

Сообщений: 108

21.09.2014, 01:44

 [ТС]

3

Fairuza, ну так это я и захожу в параметры-надстройки



0



0 / 0 / 0

Регистрация: 30.01.2014

Сообщений: 22

01.03.2016, 00:02

4

Аналогичная проблема случилась.

Все работало как положено, офис 2013. Несколько дней назад эксель завершился аварийно, с ошибкой, после этого com-надстройка power map перестала автоматически загружаться при запуске эксель.
Через файл-параметры-надстройки можно поставить галочку, она активируется, становится доступной, с ней можно работать, но только до завершения работы в эксель. После запуска эксель ее снова нужно подгружать вручную, при этом в окне надстроек на этой единственной надстройке стоит «поведение при загрузке: выгружен» даже если на ней стоит галочка и она доступна для работы в текущем сеансе работы эксель. Что можно сделать чтобы она стала автоматически подгружаться как раньше?



0



0 / 0 / 0

Регистрация: 21.10.2016

Сообщений: 1

21.10.2016, 14:17

5

Добрый день! Возникла такая же проблема, как и у товарища qmt, и тоже с офисом 2013. Решить ее удалось путем редактирования реестра windows. Надо пройти по пути HKEY_CURRENT_USERSoftwareMicrosoftOfficeExcel Addins, выбрать раздел с именем своей надстройки и поменять значение ключа LoadBehavior на «3».
Я понимаю, что для авторов эта проблема уже не актуальна, но, возможно, решение пригодится кому-нибудь в будущем.



0



 

V

Пользователь

Сообщений: 5018
Регистрация: 22.12.2012

Есть надстройка. Она лежит в папке c:Program Files (x86)Microsoft OfficeOffice12XLSTART. На большинстве компов запускается норм. а на одном при запуске экселя не запускается, но запускается если запускать именно через неё, т.е. двойной клик по самому файлу надстройки. Windows 7×64 offise 2007. Подскажите куда копать. :)

 

The_Prist

Пользователь

Сообщений: 14182
Регистрация: 15.09.2012

Профессиональная разработка приложений для MS Office

Даже самый простой вопрос можно превратить в огромную проблему. Достаточно не уметь формулировать вопросы…

 

V

Пользователь

Сообщений: 5018
Регистрация: 22.12.2012

нет. не мой случай. :(

 

The_Prist

Пользователь

Сообщений: 14182
Регистрация: 15.09.2012

Профессиональная разработка приложений для MS Office

А если поместить в папку XLSTART другой файл какой-нибудь — он будет запускаться на этом ПК?

Даже самый простой вопрос можно превратить в огромную проблему. Достаточно не уметь формулировать вопросы…

 

V

Пользователь

Сообщений: 5018
Регистрация: 22.12.2012

The_Prist, в папке 4 файла xla, один основной и 3 вспомогательных. вспомогательные загружаются а основной нет. Покрайнемере в окне VBA они (вспомогательные) есть.

Изменено: V21.04.2017 15:32:02

 

V

Пользователь

Сообщений: 5018
Регистрация: 22.12.2012

Еще один момент. просто запускаю тотал и из него запускаю надстройку то тоже не запускается. Если запускаю тотал с правами админа то надстройка запускается. Похоже гдето винда блокирует.

 

The_Prist

Пользователь

Сообщений: 14182
Регистрация: 15.09.2012

Профессиональная разработка приложений для MS Office

Попробуйте антивирус отключить на время — может он блокирует.

Даже самый простой вопрос можно превратить в огромную проблему. Достаточно не уметь формулировать вопросы…

 

V

Пользователь

Сообщений: 5018
Регистрация: 22.12.2012

#8

29.04.2017 09:59:56

Пуск — Панель управления — Учетные записи пользователей — Изменение параметров контроля учетных записей — ползунок в самый низ.  Данная процедура помогла.

Понравилась статья? Поделить с друзьями:
  • Не загружается word что делать
  • Не двигать столбец в excel
  • Не загружается word 2016
  • Не двигается таблица в excel вправо
  • Не загружается microsoft word