Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macros not working after task reload

Hi All,

I am having some problems getting macros working on our Qlikview server. The macros work fine if I reload the data locally in a Qlikview client and then publish the file, however if I add a task that first reloads the data and then publishes the file then the macros do not work anymore (they are not executed). It is not only that the macros does not work when accessing the file trough the IEPlugin, they do not work even if I open the qvw file in a local client. Does anybody know the reason for this and who to get around it?

Any help appreciated.

11 Replies
magavi_framsteg
Partner - Creator III
Partner - Creator III

Hi Robbjohn.

Do you mean you have macros who execute OnPostReload?

If so:

- Macros are *only* executed on manual reloads via QV Desktop (QV.exe)

- Macros are *not* executed when reloading via Publisher (QVB.exe)

What are you trying to do in your macro code?

Kind regards

Magnus Åvitsland

BI Consultant

Framsteg Business Intelligence Corp.

Not applicable
Author

Hi Magnus.

No, the marcos are not triggered by the OnpostReload event. They are normal macros that are triggered by a button. The macros first create a text file and then execute a command.

As I previously said, the macros work fine if I just publish the document, however if I add a task to reload the document then after the reload the macros do not work anymore (they are not executed)....

magavi_framsteg
Partner - Creator III
Partner - Creator III

Hi again.

Do you have "Document properties > Security > Macro override security" checked?

Kind regards

Magnus Åvitsland

BI Consultant

Framsteg Business Intelligence Corp.

Miguel_Angel_Baeyens

Hi,

Do you mean that after publishing the document, you click on the buttons and that no longer triggers the macros? Does it work if you use the Launch action instead? Are you allowing unsafe macro execution on server?

Did you open the distributed documents with Desktop to check whether or not the macro still works?

Miguel

Not applicable
Author

Hi Miguel.

Let be more exact.

Imagine two scenarios.

First scenario: I create a task that publishes the document. Macros work fine.

Second scenario: I create a task that first reloads the data and then publishes the document. Macros do not work anymore. Does not matter if i open the document in a desktop client or trough the IEplugin, macros are simply not executed, i.e. something happens to the file when it is reloaded. However if i reload the file in a desktop client macros continue to work.

Macro override security is checked.

I am allowing unsafe macros.

Miguel_Angel_Baeyens

Hi,

The only difference between Desktop reloads and Publisher (not Server) reloads is that QlikView Publisher removes the script to the published documents. It's not a bug, as far as I know. So it would make sense if you were loading your macros in the script, as long as it is removed by Publisher (open any reloaded file and you will see a comment line noting that there is no script).

Which version of QlikView are you running? Does the module editor have macros even if they are not executed when you open the reloaded document in Desktop?

Hope that makes sense.

Miguel

Not applicable
Author

Ok, so i found the problem (silly problem, silly me), but I do not know why it occurs.

It seems like when a .qvw is reloaded trough a task, triggers are removed (I said earlier that macros are executed trough buttons, when they really are executed trough triggers when a certain selection is made. Did not think it mattered). So any body knows why this happen, and how to avoid it?

magavi_framsteg
Partner - Creator III
Partner - Creator III

Hi again robbjohn.

Triggers should never be automatically removed depending on how the reload was made - so be it manual or by publisher task.

However ,if you have a field event trigger OnChange, the trigger will be removed if the underlying field gets removed from your data model. Even if the field comes back, the trigger will still be gone.

This behavior was reported as a bug on QV v9 by me a few years ago, but it still exists as of QV v11 SR1.

Kind regards

Magnus Åvitsland

BI Consultant

Framsteg Business Intelligence Corp.

Not applicable
Author

Hi Magnus.

Hm, I am not using the OnChange but the OnSelection event... But if I understand you correctly this basically should not happen, yet it does (however as I mentioned earlier if the document is reloaded in a desktop client it does not happen)... A new bug? We are using QV11....