Summary
EnsureCEALibraryLoaded (source/bind/excel/vba/modCEADeclare.bas) calls the Win32 SetDllDirectoryW API when resolving cea_excel.dll's folder. This call changes the DLL search order for the entire Excel process, not just this workbook, and is never reset afterward.
Reproduction
- Interface: Excel/VBA
- Open two macro-enabled workbooks in the same Excel session, one using the CEA Excel wrapper; inspect DLL search behavior for the other workbook's add-ins afterward.
Expected behavior
DLL directory scoping should be workbook-local (e.g. via LOAD_LIBRARY_SEARCH_* flags on LoadLibraryExW, or restoring the previous SetDllDirectoryW value after loading) rather than a persistent process-wide side effect.
Actual behavior
Loading the CEA wrapper in one workbook can affect DLL resolution for unrelated add-ins/workbooks open in the same Excel session.
Environment
- OS: 64-bit Windows Excel
- CEA version/commit:
main as of 2026-09-02
Additional context
source/bind/excel/vba/modCEADeclare.bas, EnsureCEALibraryLoaded, around the SetDllDirectoryW call.
Drafted with Claude's assistance
- Confirmed by reading
EnsureCEALibraryLoaded in full and noting no corresponding reset/restore call exists anywhere in the module.
Summary
EnsureCEALibraryLoaded(source/bind/excel/vba/modCEADeclare.bas) calls the Win32SetDllDirectoryWAPI when resolvingcea_excel.dll's folder. This call changes the DLL search order for the entire Excel process, not just this workbook, and is never reset afterward.Reproduction
Expected behavior
DLL directory scoping should be workbook-local (e.g. via
LOAD_LIBRARY_SEARCH_*flags onLoadLibraryExW, or restoring the previousSetDllDirectoryWvalue after loading) rather than a persistent process-wide side effect.Actual behavior
Loading the CEA wrapper in one workbook can affect DLL resolution for unrelated add-ins/workbooks open in the same Excel session.
Environment
mainas of 2026-09-02Additional context
source/bind/excel/vba/modCEADeclare.bas,EnsureCEALibraryLoaded, around theSetDllDirectoryWcall.Drafted with Claude's assistance
EnsureCEALibraryLoadedin full and noting no corresponding reset/restore call exists anywhere in the module.