Too many module-level variables
Module-level variables are those declared in the Declarations section of a module, before the module's procedures. This error has the following cause and solution:
The sum of the memory requirements for all module-level variables in this module exceeds 64K.
This is the storage limit for this module. If appropriate, you can declare some of your variables as Public in another module, or if some module-level variables are used only in one procedure, you can declare them within that procedure. If you declared variables at module level because you want them to retain their value between procedure invocations, you can instead declare them as Static within the procedure in which they are referenced.
Note Available space can vary among operating systems.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.