Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to execute macro with from another QVW? (PDF + Email issues)

Hi all!

This time I have a macro issue which don't let me doing what I want.

Basically this is want I want to do:

In one document named "Email.qvw" I have a Vbscript Module which is in charge of opening another document named "Private.qvw" in order to print a report in a specified directory. As it name sounds, the first document "Email.qvw" is in charge of sending an email with the document just printed out in attachement...

So basically I Want : Open a document, print out a pdf in a directory, and send an email with this pdf in attachement... Not as easy as it sounds...

The fact is, because it's a pdf document that I want to print out, I wrote a vbscript to do so by changing some registry key values of the "PdfCreator" program. This vbscript is in the second document named "Private.qvw".

At this hour, the only way I found to do that is to creat a button and trigger the macro by pressing down this button...

BUT (and there is the point of this new threat), this kind of trick is ok if wanted only one document to be printed out and mailed... The problem is by pressing this button, QlikView don't wait the end of the program in "Private.qvw" before sending its email !!! So I receive an email with... nothing in attachement !!! In fact the pdf file creation isn't finished when the mailing program is executing...

So, to be clear, this is the process I have done (don't work properly):

Email.qvw :

1) Open "Private.qvw"

2) Press the Button "BU01" in "Private.qvw" which call an external event "Macro" to print out a report in a pdf file

3) Send an email with the pdf file in attachement

What I want :

1) Open "Private.qvw"

2) call the Macro "Print" in "Private.qvw" module to print out a report in a pdf file

3) Wait until the end of the process 2)

4) Send an email with the pdf file in attachement

Please don't tell me the "GetApplication.Sleep" function as it stops all processes of QlikView even the one that I want to be finished...

Thank you for your answers, solutions and time...

Jonrod

Best regards

0 Replies