Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
its_anandrjs

Macro Not working from Windows Task Scheduler

Dear All,

Any one has a experience  same please let me know.

1. I am using a macro to send three objects data to excel.

2. Using a macro to send this excel data to users mail id.

3. I am using Windows Task scheduler to reload this QVW where i have excel and email macro to extract excel and send email. (which is manually working fine also from macro module fine)

 

Problem description:-

1. I am using a Windows task scheduler to reload this QVW but it is not working.

2. After reload from win task scheduler when open QVW in Qlikview desktop then i get message "enable safe macros"

Attached are QVW and Bat file.

Regards

Anand

 

 

Labels (2)
3 Replies
johngouws
Partner - Specialist
Partner - Specialist

Hi Anand. 

I used to use macro's for printing some time ago. A couple of thinks I recall. When setting the macro you need to enable security. See snippet: 


Macro Page.JPG

This example of the scheduler is running on a Server 2008 R2 server. I recall having to fiddle a bit with the settings on the general page. This example actually is in production: See snippets: 

Schedule_1.JPGSchedule_actions.JPG

The contents of my batch file is slightly different to yours: 

"C:\Program Files\QlikView\qv.exe" /r /NoSecurity "F:\QlikView Projects\Trackers\QVD Builder (extract).qvw" including the double quotes! 

The message "enable safe macro", I think its the bottom option you need to accept. (least sake one). It only used to ask me that the first time. 

Hopefully this will point you in the right direction. 

 

 

 

its_anandrjs
Author

Hi,

I am using the same settings that you suggested also my bat string only contains /l in place of /r because it reloads and run the macro codes.

 

Ex for bat script.

"C:\Program Files\QlikView\qv.exe" /l "E:\temp\Macro_Test_Mark_1_ForTest.qvw"

Please check my files at your PC and check with win scheduler will it works.

Regards,

Anand

marcus_sommer

In general your approach could work because I'm doing the same since many years. If it's dont work it's often caused of missing access rights and/or none valid qv licence and/or proper settings within the settings.ini.

 

For me it only worked if I'm always logged in my server which means my USER executed the task and runs qv. If none user is logged in or is taken to run the task and/or qv (maybe with an additionally runas-batch) the windows default-user is taken and might not have any access rights to the used files or even a licence and also the right configurations in the settings.ini. I assume that there are ways to get it also working with the windows default user but after I found a workaround I never tried to change it. Therefore I suggest to inquiry your issue from this direction.

 

- Marcus