<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Set command breaks macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120634#M604552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can pass variables as parameters to the macro.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;let vSubject=peek(...);&lt;/P&gt;&lt;P&gt;let vAddress=peek(...);&lt;/P&gt;&lt;P&gt;set vBody='Body Text';&lt;/P&gt;&lt;P&gt;let vSendEmail = SendEmail(vSubject,vAddress,vBody);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro:&lt;/P&gt;&lt;P&gt;function SendEmail(pSubject,pAddress,pBody)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;emailObj.To = pAddress&lt;/P&gt;&lt;P&gt;emailObj.Subject&amp;nbsp; = pSubject&lt;/P&gt;&lt;P&gt;emailObj.TextBody = pBody&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2018 20:07:12 GMT</pubDate>
    <dc:creator>cwolf</dc:creator>
    <dc:date>2018-07-09T20:07:12Z</dc:date>
    <item>
      <title>Set command breaks macro</title>
      <link>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120629#M604547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this working but want to pass the subject along as a variable and use it in the subject (emailObj.Subject&amp;nbsp; = varSubject ) when the email gets sent out. If I add the two lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Set varSubject = ActiveDocument.Variables("vSubject").GetContent.String&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'emailObj.Subject&amp;nbsp; = varSubject&lt;/P&gt;&lt;P&gt;the email will not get sent out. As soon as I comment them it works again. Any Set command I use will break it and email will not go out.&lt;/P&gt;&lt;P&gt;the vSubject variable is created in the load script. I might have 0, 1 or many emails to send out so I am using the For/Next loop.&lt;/P&gt;&lt;P&gt;Should I be creating the variable in a different manner?&lt;/P&gt;&lt;P&gt;Is there a way to debug the macro. Maybe see the errors?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;&lt;SPAN style="color: #000000;"&gt;//&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp; Partial Load Script&amp;nbsp; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG style="color: #333333; font-size: 9pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="color: #333333;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;NumRows&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;('ContractAlert') ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000000; font-size: 9pt; font-family: 'Courier New';"&gt;FOR&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;=1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;$(NumRows)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #333333; font-size: 9pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #333333;"&gt; &lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;vEmailSubject&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;Peek&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;('Contract',&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;$(i)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;vSendEmail&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New';"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New';"&gt;SendEmail&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New';"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt; (vEmailSubject);&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #575757; font-size: 9pt; font-family: 'Courier New';"&gt;NEXT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-size: 9pt; font-family: 'Courier New';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; FUNCTION&amp;nbsp; IN MACRO&amp;nbsp; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;Function SendEmail()&lt;BR /&gt; Set emailObj&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = CreateObject("CDO.Message")&lt;BR /&gt; Set emailConfig = emailObj.Configuration&lt;BR /&gt; &lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'AS SOON AS I USE ANY SET BEYOND THE TWO LISTED ABOVE THE EMAIL WILL NOT SEND&lt;BR /&gt; 'Set varSubject = ActiveDocument.Variables("vSubject").GetContent.String&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserver" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;&lt;SPAN&gt;") = "10.21.20.72"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserverport" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserverport&lt;/A&gt;&lt;SPAN&gt;") = 25&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/sendusing" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendusing&lt;/A&gt;&lt;SPAN&gt;")&amp;nbsp;&amp;nbsp;&amp;nbsp; = 2 &lt;/SPAN&gt;&lt;/P&gt;&lt;OL style="list-style-type: lower-alpha;"&gt;&lt;LI&gt;emailConfig.Fields.Update&lt;/LI&gt;&lt;LI&gt;emailObj.From&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;A href="mailto:123@456.COM"&gt;123@456.COM&lt;/A&gt;&lt;BR /&gt; emailObj.To&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;A href="mailto:dale@mercymooselake.org"&gt;123@456.COM&lt;/A&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/LI&gt;&lt;LI&gt;emailObj.Subject&amp;nbsp; = "test"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'THIS WORKS&lt;BR /&gt; 'emailObj.Subject&amp;nbsp; = varSubject&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'THIS DOES NOT WORK&lt;BR /&gt; emailObj.TextBody = "Test CDO"&lt;BR /&gt; &lt;BR /&gt; &lt;/LI&gt;&lt;LI&gt;emailObj.Send&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2018 20:31:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120629#M604547</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2018-07-06T20:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set command breaks macro</title>
      <link>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120630#M604548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Try:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;varSubject = ActiveDocument.Variables("vSubject").GetContent.String&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 12:09:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120630#M604548</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2018-07-09T12:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set command breaks macro</title>
      <link>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120631#M604549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help. I get a little confused on functions.&lt;/P&gt;&lt;P&gt;I am now getting --&amp;nbsp; Object required: 'ActiveDocument.Variables(...)'&lt;/P&gt;&lt;P&gt;when I click the test button in the module editor and the email does not get sent when I run the load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;load script&lt;/STRONG&gt;&lt;/SPAN&gt; I have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vSubject=Peek('Contract',$(i));&lt;/P&gt;&lt;P&gt;I am amusing this is the magic that creates the variable that can be used in the macro by taking the value of the contract field? Contract is a field in the table. Is it correct to say that vSubject should now be in memory?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the &lt;STRONG style="text-decoration: underline;"&gt;vbscript/macro &lt;/STRONG&gt;I have&lt;/P&gt;&lt;P&gt;Dim VarSubject&lt;/P&gt;&lt;P&gt;VarSubject = ActiveDocument.Variables("vSubject").GetContent.String&lt;/P&gt;&lt;P&gt;emailObj.Subject&amp;nbsp; = VarSubject&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 12:55:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120631#M604549</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2018-07-09T12:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set command breaks macro</title>
      <link>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120632#M604550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can see the contents of any variable in Settings &amp;gt; Variable Overview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the variable is null or has strange characters, that could be the reason why it's not working. You can also use the Set in the script for a fixed text, instead of a variable, to see whether it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: on a second read, two thoughts:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;No, any ActiveDocument property does not exist when reloading the script, for this the document needs to be open after a reload&lt;/LI&gt;&lt;LI&gt;It could be a typo but the names of the variables are different in the script (vEmailSubject) and in the macro (vSubject)&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 14:20:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120632#M604550</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-07-09T14:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set command breaks macro</title>
      <link>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120633#M604551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Am I on the right track in the load script with?&amp;nbsp; --&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET vSubject=Peek('Contract',$(i));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Will this do what it takes to make it available to a Macro/function called from my load script?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I do not see vSubject in Settings&amp;gt;Variable Overview.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;So I cannot use ActiveDocument because it is not available until after the reload is done? Does this mean that all lines be&amp;nbsp; interpreted and you are back to the document &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;OR &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;from LOAD to ; since there can be multiple loads? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;How do I make the value available when I am running the macro? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Here is what I need to do. I have it all working except for the subject field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;1. Load script loads from a SQL query. The results show only the records where the 'Contract' due date is current. There might be 0, 1 or many contracts due.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;2. &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;The FOR NEXT loop will handle each record (Contract) and send an email to the specific person that needs to act on it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;3. A Function/Macro will be used to send that email. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I have everything working except for being able to use variables in the Subject, Body or Address. If it helps I can supply the simplified code with an in line table. This will take a little time and I wanted to get back as soon as possible.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 17:24:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120633#M604551</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2018-07-09T17:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set command breaks macro</title>
      <link>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120634#M604552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can pass variables as parameters to the macro.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;let vSubject=peek(...);&lt;/P&gt;&lt;P&gt;let vAddress=peek(...);&lt;/P&gt;&lt;P&gt;set vBody='Body Text';&lt;/P&gt;&lt;P&gt;let vSendEmail = SendEmail(vSubject,vAddress,vBody);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro:&lt;/P&gt;&lt;P&gt;function SendEmail(pSubject,pAddress,pBody)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;emailObj.To = pAddress&lt;/P&gt;&lt;P&gt;emailObj.Subject&amp;nbsp; = pSubject&lt;/P&gt;&lt;P&gt;emailObj.TextBody = pBody&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 20:07:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120634#M604552</guid>
      <dc:creator>cwolf</dc:creator>
      <dc:date>2018-07-09T20:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set command breaks macro</title>
      <link>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120635#M604553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;SPAN style="font-size: 14pt; font-family: Arial, sans-serif; color: black; text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;Thank you for getting me back on track. I did start by trying to do it that way but had my syntax off.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: #000000;"&gt;In my FOR/NEXT loop I was using &lt;STRONG style="font-size: 9pt; font-family: Arial, sans-serif;"&gt;FOR&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="font-size: 9pt; font-family: Arial, sans-serif;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; font-family: Arial, sans-serif;"&gt;=&lt;STRONG&gt;1&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: Arial, sans-serif;"&gt;to&lt;/SPAN&gt; &lt;SPAN style="font-size: 9pt; font-family: Arial, sans-serif;"&gt;$(NumRows) When I should have been using i=0 as PEEK starts at zero. Below I have included enough of the Load and Macro to get someone else started if they want to send separate emails to multiple people.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9pt; font-family: Arial, sans-serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: gray;"&gt;&lt;SPAN style="color: #000000;"&gt;I have seen a lot of negative opinions on using macros but could not make it work any other way.&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: #000000;"&gt;I did start by trying to use the Alerts. I was not able to get it to send to multiple people each with its specific Contract number. If anyone sees this and wants to enlighten m&lt;/SPAN&gt;e&lt;SPAN style="color: #333333;"&gt; I would appreciate it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;SPAN style="font-size: 14pt; font-family: Arial, sans-serif; color: black; text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;SPAN style="font-size: 14pt; font-family: Arial, sans-serif; color: black; text-decoration: underline;"&gt;LOAD SCRIPT&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;ContractAlert:&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt; * ,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;()-&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;RenewContractDate&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;Noofdays&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;Inline&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;[ &lt;BR /&gt; Name, UserId, Contract,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RenewContractDate, Email&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: green;"&gt;&lt;SPAN&gt;Bob, bobH00,&amp;nbsp;&amp;nbsp;&amp;nbsp; 56940,&amp;nbsp;&amp;nbsp;&amp;nbsp; 6/20/2018, &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:bob@CFG123.org"&gt;bob@CFG123.org&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; Joe, JoeH01,&amp;nbsp;&amp;nbsp;&amp;nbsp; 12342,&amp;nbsp;&amp;nbsp;&amp;nbsp; 6/14/2018, &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:joe@CFG123.org"&gt;joe@CFG123.org&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; Sally,&amp;nbsp;&amp;nbsp;&amp;nbsp; SalH01,&amp;nbsp; 29846, 6/12/2018, &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:sally@CFG123.org"&gt;sally@CFG123.org&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;NumRows&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;('ContractAlert');&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;FOR&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;i&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=0 &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;to&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;$(NumRows)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;vSubject&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: blue;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;('Contract',&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;$(i)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;ContractAlert&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;); &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;SET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;vBody&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;='Your Contract needs to be updated';&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;vSendEmail&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: maroon;"&gt;SendEmail&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;(vSubject,vBody);&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9.0pt; font-family: 'Arial',sans-serif;"&gt;NEXT&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;&lt;BR /&gt; ; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;SPAN style="font-size: 16pt; font-family: Arial, sans-serif; color: black; text-decoration: underline;"&gt;Function/Macro&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Arial',sans-serif; color: black;"&gt;function SendEmail(pSubject,pBody)&lt;BR /&gt; &lt;BR /&gt; Set emailObj = CreateObject("CDO.Message")&lt;BR /&gt; Set emailConfig = emailObj.Configuration&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserver" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserver&lt;/A&gt;&lt;SPAN&gt;") = "10.55.60.76"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/smtpserverport" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/smtpserverport&lt;/A&gt;&lt;SPAN&gt;") = 25&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; emailConfig.Fields("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.microsoft.com/cdo/configuration/sendusing" rel="nofollow" target="_blank"&gt;http://schemas.microsoft.com/cdo/configuration/sendusing&lt;/A&gt;&lt;SPAN&gt;")&amp;nbsp;&amp;nbsp;&amp;nbsp; = 2 &lt;/SPAN&gt;&lt;BR /&gt; emailConfig.Fields.Update&lt;BR /&gt; &lt;BR /&gt; emailObj.From&amp;nbsp;&amp;nbsp;&amp;nbsp; = "elvis@cfg123"&lt;BR /&gt; emailObj.To&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = " elvis@cfg123"&lt;BR /&gt; emailObj.Subject&amp;nbsp; = pSubject&lt;BR /&gt; emailObj.TextBody = pBody&lt;BR /&gt; &lt;BR /&gt; emailObj.Send&lt;BR /&gt; &lt;BR /&gt; End Function &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 19:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-command-breaks-macro/m-p/120635#M604553</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2018-07-10T19:10:24Z</dc:date>
    </item>
  </channel>
</rss>

