<?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: Macro Date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571866#M213054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/21667"&gt;Clever Anjos&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You solution will most likely work for &lt;A href="https://community.qlik.com/qlik-users/79561"&gt;realpixel&lt;/A&gt; judjing by the format of the date in the error message.&amp;nbsp; It doesn't work for me because my Windows settings for the date format is M/D/yyyy, hence the result is 2262014.&amp;nbsp; Had to do some formatting...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Feb 2014 21:19:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-02-26T21:19:02Z</dc:date>
    <item>
      <title>Macro Date</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571863#M213051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;It’s a part of macro to generate a report in PDF&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Sub Dagrapport&lt;BR /&gt; &lt;BR /&gt; ActiveDocument.reload&lt;BR /&gt; &lt;BR /&gt; ActiveDocument.save&lt;BR /&gt; &lt;BR /&gt; vReport = "RP01" 'Set report&lt;BR /&gt; vName = "Rapport_Synthese_Sarissa" 'Name of output pdf&lt;BR /&gt; ActiveDocument.PrintReport(vReport), "Bullzip PDF Printer", false 'Printreport&lt;BR /&gt; reportFile = "c:\temp\" &amp;amp; vName &amp;amp;"_" &amp;amp; Date &amp;amp; ".pdf"&amp;nbsp;&amp;nbsp; 'Setting outputname&lt;BR /&gt; MyPrintPDFWithBullZip(reportFile) 'Call pdf printer&lt;BR /&gt; ActiveDocument.GetApplication.Sleep 5000&lt;BR /&gt; zendDagrapport&lt;BR /&gt; End sub &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I run this macro, I have the following message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://community.qlik.com/legacyfs/online/53850_pastedImage_0.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It’s seem that the problem is due to the format of the date DD/MM/YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use in my script value “&amp;amp; Date &amp;amp;” but this function take the date at format DD/MM/YYYY, if I remove this function, it’s work perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In need to have the date at the format DDMMYYYY, there are an issue to solve my problem? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 11:18:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571863#M213051</guid>
      <dc:creator>realpixel</dc:creator>
      <dc:date>2014-02-26T11:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Date</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571864#M213052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this with some changes in &lt;STRONG&gt;bold&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub Dagrapport&lt;BR /&gt;&lt;STRONG&gt; dim M&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; if len(month(Date))=1 then &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; M = "0"&amp;amp;month(Date) &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; else &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; M = month(Date) &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; end if&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; ActiveDocument.reload&lt;/P&gt;&lt;P&gt; ActiveDocument.save&lt;/P&gt;&lt;P&gt; vReport = "RP01" 'Set report&lt;BR /&gt; vName = "Rapport_Synthese_Sarissa" 'Name of output pdf&lt;BR /&gt; ActiveDocument.PrintReport(vReport), "Bullzip PDF Printer", false 'Printreport&lt;BR /&gt; reportFile = "c:\temp\" &amp;amp; vName &amp;amp;"_" &amp;amp; &lt;STRONG&gt;day(Date) &amp;amp; M &amp;amp; year(Date)&lt;/STRONG&gt; &amp;amp; ".pdf"&amp;nbsp;&amp;nbsp; 'Setting outputname&lt;BR /&gt; MyPrintPDFWithBullZip(reportFile) 'Call pdf printer&lt;BR /&gt; ActiveDocument.GetApplication.Sleep 5000&lt;BR /&gt; zendDagrapport&lt;BR /&gt; End sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 20:56:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571864#M213052</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-26T20:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Date</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571865#M213053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try changing&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;=reportFile = "c:\temp\" &amp;amp; vName &amp;amp;"_" &amp;amp; Date &amp;amp; ".pdf"&amp;nbsp;&amp;nbsp; 'Setting outputname&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Courier New';"&gt;reportFile = "c:\temp\" &amp;amp; vName &amp;amp;"_" &amp;amp; replace(cstr(Date),"/","") &amp;amp; ".pdf"&amp;nbsp;&amp;nbsp; 'Setting outputname&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 21:02:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571865#M213053</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2014-02-26T21:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Date</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571866#M213054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/21667"&gt;Clever Anjos&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You solution will most likely work for &lt;A href="https://community.qlik.com/qlik-users/79561"&gt;realpixel&lt;/A&gt; judjing by the format of the date in the error message.&amp;nbsp; It doesn't work for me because my Windows settings for the date format is M/D/yyyy, hence the result is 2262014.&amp;nbsp; Had to do some formatting...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 21:19:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571866#M213054</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-26T21:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Date</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571867#M213055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Clever,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your assistance, it's works fine, but I have a last question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I must to send this report by email.&lt;/P&gt;&lt;P&gt;The report generate is named "Rapport_Synthese_Sarissa - _27022014.pdf"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the code under, If I put the name "Rapport_Synthese_Sarissa - _27022014.pdf" in the function "objEmail.AddAttachment" it's work perfectly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But my problem that this report is reloaded every day, and &lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;the file name&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;will change&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;daily&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;depending on&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the date (tomorrow the file will be Rapport_Synthese_Sarissa - _28022014.pdf)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to add in function objEmail.AddAttachment the name and the date of the file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try this command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objEmail.AddAttachment "c:\temp\" &amp;amp; vName &amp;amp;"_" &amp;amp; replace(cstr(Date),"/","") &amp;amp; ".pdf" ' Attachement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objEmail.AddAttachment "c:\temp\" &amp;amp; vName &amp;amp;".pdf" ' Attachement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it's not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;objEmail.To = "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:pascal.maillot@bollore.com"&gt;tes@1.2.3&lt;/A&gt;&lt;SPAN&gt;" 'Email Recipient&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;objEmail.From = "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:qlikview.report@bollore.com"&gt;qlikview.report@1.2.3&lt;/A&gt;&lt;SPAN&gt;" 'Email Sender&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;objEmail.Subject = "TEST1" ' Subject&lt;/P&gt;&lt;P&gt;objEmail.TextBody = "TEST 2" 'Text Body&lt;/P&gt;&lt;P&gt;'objEmail.AddAttachment "c:\temp\Rapport_Synthese_Sarissa.pdf" ' Attachement&lt;/P&gt;&lt;P&gt;'objEmail.AddAttachment "c:\temp\" &amp;amp; vName &amp;amp;"_" &amp;amp; replace(cstr(Date),"/","") &amp;amp; ".pdf" ' Attachement&lt;/P&gt;&lt;P&gt;objEmail.AddAttachment "c:\temp\" &amp;amp; vName &amp;amp;".pdf" ' Attachement&lt;/P&gt;&lt;P&gt;objEmail.Send&lt;/P&gt;&lt;P&gt;Set objFlds = Nothing&lt;/P&gt;&lt;P&gt;Set objConf = Nothing&lt;/P&gt;&lt;P&gt;Set objEmail = Nothing&lt;/P&gt;&lt;P&gt;' msgbox ("Test Mail Sent")&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 10:27:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571867#M213055</guid>
      <dc:creator>realpixel</dc:creator>
      <dc:date>2014-02-27T10:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Date</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571868#M213056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;reportFile = "c:\temp\" &amp;amp; vName &amp;amp;"_" &amp;amp; replace(cstr(Date),"/","") &amp;amp; ".pdf"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;objEmail.AddAttachment&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;reportFile &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 19:51:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Date/m-p/571868#M213056</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2014-02-27T19:51:22Z</dc:date>
    </item>
  </channel>
</rss>

