Runtime Error 47: “Too many DLL application clients,” explained and fixed

Error 47, “Too many DLL application clients”, is a survivor from 16-bit and early 32-bit Windows, when a shared DLL could only serve a fixed number of attached applications at once. The documented message still exists in VBA, and the error still occasionally surfaces when legacy components are loaded repeatedly, or when code attaches to a shared library in a loop without releasing it. On a modern system it is best read as “something is consuming shared component connections without letting go.”

For people who just run the program

  1. Expect this only with old software. Error 47 belongs to programs and components from the Windows 95/98 and early NT era, or modern macros driving those components.
  2. Close other programs using the same component, then retry. If several legacy tools share one data or reporting engine, they may genuinely be competing for a limited number of slots.
  3. Restart the application rather than just the macro. Connections from a failed run are often held until the process exits; a fresh process starts with a clean count.
  4. Report how many programs were open. For this error, “it only fails when the other tool is running” is the diagnosis, not a coincidence.

For people who write the code

  1. Release what you attach, every time. Code that opens a connection, loads a library object, or starts a component session in a loop must close it in the same iteration, including on error paths.
  2. Load once, reuse. If a component is needed throughout a session, create it once at start-up and hold the reference, rather than attaching per operation and multiplying client counts.
  3. Dim engine As Object
    Set engine = CreateObject("Legacy.Engine")  ' attach once
    ' ... use engine for the whole session ...
    Set engine = Nothing                          ' release at the end
  4. Check failed runs. A macro that crashes mid-way can leave its client slot occupied until the host process ends. Counting clients across repeated failures in one session is a common way this error “appears from nowhere.”
Error 47 is not about memory or disk space. The limit is a connection count inside an old-style shared component. Freeing RAM or disk changes nothing; releasing connections, or restarting the processes holding them, does.

If it still happens

If error 47 appears with nothing else running, the component itself may be miscounting because of a corrupted installation: reinstall the component, and check for leftover processes from earlier crashed sessions still holding attachments (Task Manager will show them).

Common questions

Is error 47 still possible on modern Windows? Rarely, and almost only through legacy components that keep the old client-count design. VBA retains the error and its message because those components still exist in the wild.

How many clients is “too many”? There is no single number; the limit belongs to the component, not to VBA. Historical shared DLLs often allowed only a handful of simultaneous attachments.

Related errors

Runtime Error 48 · Runtime Error 49 · Runtime Error 429