You can actually do this by actually making the executed macro code dynamic, using the VBS ExecuteGlobal command.
See the attached (save them to the same location). The document has a variable vVar1 which has my name in it (fame at last?!). In the module code is a macro called runCode that can be executed by clicking on the 'test' button on the main sheet. This calls a sub called include that receives the passed file name, reads the contents and then executes the contents using ExecuteGlobal.
So the code isnt 'included' but dynamically executed - try changing the msgbox in 'hello.txt' in between clicking 'test' and see the results change.
This also means that the document doesnt have to be refreshed or anything to use the changed macro code. So you would just put your common macro code into individual .txt files and where you want to use them execute the sub as occurs in 'runCode' in the module with the corresponding file name.
Thanks for the reply, and that does seem to work. Unfortunately, I was hoping to use a native QlikView command or built-in feature so I didn't have to give the document "System Access." This wouldn't run on our server, and probably wouldn't work in AJAX.
All my macros are safe QlikView API calls (zoom, export, print, setting variables, etc) that are functional on the server through the AJAX client, was just wondering if there was an easy way to store those centrally in one place, and then easily include/reference them in each QVW.
Your workaround definitely works and is simple enough to implement, but I suppose there is no other method?