You could also put the macro code in a OnOpen trigger, and then make the QVW reload via an External Program call (Enterprise Mgmt Console, System, Supporting Tasks, External Programs for the reload server) with a command line call such as
"C:\Program Files\QlikView\qv.exe" /r /vvCreateCSV=1 "E:\QlikView Storage\some_qvw_name.qvw"
If you alsways want to create the CSV file you can skip the vCreateCSV variable above, but sometimes it is useful to be able to control what is done during the reload via an variable like this. If you include vCreateCSV in the call you have to test for it in the macro, using something like
set var = ActiveDocument.Variables("vCreateCSV")
val = var.GetContent.String
if val = 1 then
var.SetContent 0, true ' Set create CSV flag to 0
A potential downside of using external program calls is that you loose the more fine-grained control of the execution, for example number of retries and timeout (on the trigger pane of the job configuration dialog in Enterprise manager). But that hasn't really been an issue in cases where I've used this approach.
Please mark the post as a solution if it provided you with a solution to the topic at hand. Thanks!