This content has been marked as final. Show 2 replies
I´m using a macro that sends each monday a weekly report, but has a time problem, first it creates a pdf file on a specific folder then the pdf file is attached to an email and sent. The problem is that it takes about 1 minute for the pdf to be created and at that time the macro already attached the pdf file that was created the l week before.
Is there any way to avoid this problem???
[ code ]
if weekday(ff - 1) = 1 then
ActiveDocument.PrintReport "RP02", "QlikViewPDF", FALSE
Set objMail = CreateObject("CDO.Message")
'on error resume next
Set objMail = Nothing
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
Set WSHShell = nothing
[ /code ]