Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro runs in one file, won't run in another

I (with a lot of help from Rebecca) wrote a macro to give my users one-button export to a specified path and variable file name, based on user selections and input dates. It worked fine.

I showed it to another group of users, and they said "great, do that for us!". I copied and pasted the text of the module from one file to another, changed the variables accordingly, and tried to run it. But it won't run properly - it doesn't pick up the vStartDate and vEndDate variables from the file, and even though it says it's writing the file to the specified path, nothing is there.

I have checked security for the document, and I've set it to allow "Macro Override Security" and "Admin Override Security". Within the macro module itself, I've

selected "System Access" for requested module security, and "Allow System Access" for local security. Is there anything else I'm missing?

In the absence of an actual 'debugger', which the documentation refers to, but is nowhere to be found, I resorted to msgbox statements to try to trace execution. However, even these don't seem to work. For example:

msgbox("Start date is " & vStartDate)

gives an output message of "Start date is " - the variable doesn't show up at all. So I tried this:

set t1=ActiveDocument.Variables("vStartDate")
ts = t1.GetContent.String
msgbox("Start Date is " & ts)

Is there something wrong with this syntax?

This is driving me nuts. Something I thought should have taken less than five minutes has now taken over an hour. Anyone have any idea what else I might look at?

2 Replies
Not applicable
Author

There is nothing wrong with that syntax.  Can you screen shot your variable vStartDate from Settings > Variable Overview?

Not applicable
Author

QlikView can be infuriating at times. All of a sudden, it started working. Don't ask me why.