Недавно столкнулся с такой проблемой: После работы над проектом вдруг произошёл какой-то сбой и код перестал выполняться. При попытке открыть модуль с кодом, редактор VBA выдал следующее: Error in loading DLL. Закрыл проект и открыл его снова, отключив макросы. Модуль открылся без проблем. После сохранения и перезапуска проекта всё снова заработало, а потом опять...

В справке прочёл:
-------------------------------
Error in loading DLL (Error 48)
A dynamic link library (DLL)* is a library specified in the Lib clause of a Declare statement. This error has the following causes and solutions:
The file isn't DLL-executable.
If the file is a source-text file, it must be compiled and linked to DLL executable form.
The file isn't a Microsoft Windows DLL.
Obtain the Microsoft Windows DLL equivalent of the file.
The file is an early Microsoft Windows DLL that is incompatible with Microsoft Windows protect mode. Obtain an updated version of the DLL.
The DLL references another DLL that isn't present.
Obtain the referenced DLL and make it available to the other DLL.
The DLL or one of the referenced DLLs isn't in a directory specified by your path.
Move the DLL to a referenced directory or place its current directory on the path.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).
*dynamic-link library (DLL)
A library of routines loaded and linked into applications at run time. DLLs are created with other programming languages such as C, MASM, or FORTRAN.
------------------------------------
У меня Excel 2003, в модуле только стандартные фукции VBA и Excel, не используются никакие ссылки ни на какие DLL и не используется Win API. Кто-нибудь сталкивался с подобным? И как с этим бороться? Может ли быть причиной этой ошибки большой размер модуля, процедур или большое количество декларируемых в них переменных (глобальные переменные не используются)?