Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a QlikView document which contains an object with images and emoticons.
I developed a vbscript Macro with 3 steps :
- Select a Date value from a variable,
- Take a screenshot of the object after selection and save it as JPG file,
- Send a mail with the JPG in attachment.
1- When executing the macro with Button action, I get the wanted result : an email with the attachment and a complete screenshot :
2- When executing the macro with the "OnOpen" trigger, the mail is sent with attachment but the screenshot is incomplete and doesn't contain the images and emoticons :
Does anyone have an idea to fix this issue ?
Thanks in advance
Hi,
Did you tried to run the Macro on Post reload option?
-Jay
Maybe the calculations aren't finished when the screenshot was made. Try to put these statement before the screenshot:
ActiveDocument.GetApplication.WaitForidle
- Marcus
Hi,
Thanks for your answer.
Even On Post Reload, that doesn't work !
Hi,
Thanks for your answer.
That's the problem : the screenshot statement run before calculations.
Even ActiveDocument.GetApplication.WaitForidle or ActiveDocument.GetApplication.Sleep doesn't solve the problem.
Sleep won't help because everything is sleeping but WaitForIdle should wait for finishing the calculations. Maybe it's not directly the calculation else the rendering from gui which is working yet or the wait-statement isn't on the right place. You could post the script maybe there is what to find.
Sometimes it helped to create a virtual overhead to delay the execution maybe some loop with a calculation or further selections within the app or to run a ping-statement. But I believe it will be rather an ugly trial & error game ...
- Marcus