Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro not sending PDF email

Hello Friends

We have a Dashboard wherein I have a VB Script macro which exports a report to PDF and emails to the users.

It works find when run manually.

When we trigger the application reload with the help of a Batch file (.bat file) it reloads the application successfully and also generates the PDF report in desired folder. However it does not sends the Email. (Have used OnPostReload --> Run Macro)

Batch File  -----> Reload the Application --> OnPostReload -- > RunMacro ---> Send PDF report email.

The above scenario runs well when we manually reload the dashboard. The email is sent successfully once macro is triggered after reload.

However the email is not sent when we reload the dashboard with batch file. Only the PDF is generated in given path.

Is there something we are missing to get the emails sent while relaoding the dashboard with batch file?

Kindly help to resolve above issue. Let me know if you need any further details.

Thanks & Regards

Chintan Gala

20 Replies
marcus_sommer

The reasons are issues with the access rights of the user and/or the process and/or settings of the user. I hope the following postings are helpful for you:

Re: Sending mails macro vbs

Re: 'Execute' statement in QVW file under QMC

- Marcus

Anonymous
Not applicable
Author

Dear Marcus

Thanks for your reply. 

Reading your links,  we replaced /r  with /I  in the batch file. However the dashboard did not get reload with this.

Are we missing some trick?

Thanks & Regards

Chintan Gala

marcus_sommer

Normally it should work whereby the obvious difference is that with /l the applications remains open when the reload is finished. But maybe there are more differences ... maybe in way how this process is handled. With /r it's a kind of background-process and with /l it's like a normal GUI process and there might be differences which dll's are loaded respectively could be accessed and/or in which user-context the process happens.

Therefore with which user did you try to execute this batch and which rights and user-settings are set for him? Depending on how this batch is triggerred there might be none user which meant the windows default-user with his settings is taken.

- Marcus

Anonymous
Not applicable
Author

Dear Marcus

Have logged in to the server with Admin ID and executed the batch. How can we check the rights for the batch file/ windows?

Thanks & Regards

Chintan Gala

marcus_sommer

Could you with the admin-user open the application and do a manually reload?

- Marcus

Anonymous
Not applicable
Author

Yes we can do a manual reload.

Post manual reload it triggers the macro (OnPostReload ---> Run Macro)  and it successfully sends the email

as well. Only when the application is reloaded through batch file , the email is not sent. Only the file is generated in the folder.

Thanks & Regards

Chintan Gala

marcus_sommer

How is the batch triggerred - manually, per EXECUTE statement, windows tasks, another way?

- Marcus

Anonymous
Not applicable
Author

The batch is scheduled in Windows Task Scheduler.

marcus_sommer

In which user-context runs this task? Is there none specified the task will run with the windows default-user.

- Marcus