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

Ending an external task

Hi,
I started an external task, which execute a macro, which sends an Excel Table via Email, in an QlikView Document.

The task runs succsessfully and I recieve the email, but in the Enterprise Management Console the Task is running wihtout ending, weather the Mail have been distributed. So, every time I have to stop the reload by myself and the reload fails.


What can I do, that the reload stops itself, when finishing distirbution?
Here's the VBA-Script from my QlikView document:

'################################EMAIL-HANDLING FUNCTION#################################


Public Function SendMail (SendTo, Subject, Body, Attachment)
', Attachment, SendCC, SendBCC)


Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = Subject
objMessage.From = "QlikviewPublisher@XXX.de"
objMessage.To = SendTo
objMessage.CC = SendCC
objMessage.BCC = SendBCC
objMessage.TextBody = Body
'msgbox Attachment
if( not "" = Attachment) then
objMessage.AddAttachment Attachment
end if

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "RE-XX.XX-XX.TEDA"

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

objMessage.Send
End Function


sub email()
'Set oShell = CreateObject("WScript.Shell")'
'set fso = CreateObject("Scripting.FileSystemObject")
path = "C:\Temp\Myexport.xls"
'If fso.FileExists(path) Then
'set excelFile = fso.GetFile(path)
'excelFile.Delete
'end if

Application.Sleep(1000)

set obj = ActiveDocument.GetSheetObject("CH02")
obj.ExportBiff path


Application.Sleep(1000)


call sendmail("test.test@email.de", "Your Excel report","See attached Excel doc for details for last 30 days. The full QV report is here: https://xxx.com/xyz", path)
'ActiveDocument.GetVariable("sendTo").GetContent.String'

ActiveDocument.ClearAll False

end sub

'########################################################################################################'

Thanks for help.

1 Solution

Accepted Solutions
Not applicable
Author

you might want to look into this to compare 🙂

http://community.qlik.com/media/p/64479.aspx

View solution in original post

3 Replies
Not applicable
Author

you might want to look into this to compare 🙂

http://community.qlik.com/media/p/64479.aspx

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What is the command line of your external task?

-Rob

Not applicable
Author

Ciao Francesco,

anch'io ho problemi con un task esterno (nella Command line  statement c'è scritto:   C:\SW_CTRL_LOG_QLIK\QlikLauncher.exe 1   dove 1 è un parametro per l'eseguibile) che fa tutto quello che deve ma alla fine, invece di terminare, resta appeso.

Ho tentato di accedere al link  http://community.qlik.com/media/p/64479.aspx per vedere la tua risposta ma sembra che la pagina non sia più raggiungibile.

Mi puoi scrivere per favore, qual è la soluzione che suggerivi?

Grazie mille