<?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 to export variable value in Excel in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393755#M423396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no luck with it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Sep 2017 08:35:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-09-22T08:35:49Z</dc:date>
    <item>
      <title>Macro to export variable value in Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393753#M423394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a macro in QV to export a variable value in Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my code. When I export the variable value in Excel I am getting string value i.e. formula of the variable instead of value of the variable.&lt;/P&gt;&lt;P&gt;Variable name is&amp;nbsp; vAging_WeeklyReport_LastWeek. Excel sheet gets the "{"$(=max(Last8WeeksReferencedateOpened))"}&amp;gt;}Aggr($(vAging_Incidents_weekly),Last8WeeksReferencedateOpened)),'#0.00')" as a text instead of a value. Can somebody tell me whats going wrong and how do I get this as a value instead of a string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private sub macro_exportagingvalues(expSelection)&lt;BR /&gt; &lt;BR /&gt; dim xlapplication&lt;BR /&gt; dim xlsheet&lt;BR /&gt; &lt;BR /&gt; dim Filename &lt;BR /&gt; &lt;BR /&gt; Filename = "C:\Users\43862460\Desktop\Macros test to export object.xlsm"&lt;BR /&gt; &lt;BR /&gt; set xlapplication = createobject ("Excel.Application")&lt;BR /&gt; &lt;BR /&gt; xlapplication.Visible = True &lt;BR /&gt; &lt;BR /&gt; xlapplication.Workbooks.Open(Filename)&lt;BR /&gt; &lt;BR /&gt; set xlsheet = xlapplication.worksheets(1)&lt;BR /&gt; &lt;BR /&gt; set vAging_WeeklyReport_LastWeek = ActiveDocument.Variables("vAging_WeeklyReport_LastWeek")&lt;BR /&gt; vAging_WeeklyReport_LastWeek = vAging_WeeklyReport_LastWeek.getcontent.string&lt;BR /&gt; &lt;BR /&gt; for j = 0 to expSelection.count-1&lt;BR /&gt; &lt;BR /&gt; Select case expSelection(j).Text&lt;BR /&gt; &lt;BR /&gt; Case "HSBCNET"&lt;BR /&gt; xlsheet.range("B2").value = vAging_WeeklyReport_LastWeek&lt;BR /&gt; &lt;BR /&gt; Case "Connect Heritage"&lt;BR /&gt; xlsheet.range("B3").value = 3&lt;BR /&gt; &lt;BR /&gt; End Select&lt;BR /&gt; &lt;BR /&gt; next&lt;BR /&gt; &lt;BR /&gt; xlsheet.Saveas FileName&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; xlsheet.Application.quit&lt;BR /&gt; &lt;BR /&gt; set xlapplication = nothing&lt;BR /&gt; set xlsheet = nothing&lt;BR /&gt; &lt;BR /&gt; end sub &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 06:49:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393753#M423394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T06:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export variable value in Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393754#M423395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want the string evaluated so use the Evaluate method of the Document object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps something like this:&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;vAging_WeeklyReport_LastWeek = ActiveDocument.Evaluate(vAging_WeeklyReport_LastWeek.getcontent.string)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 07:20:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393754#M423395</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2017-09-22T07:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export variable value in Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393755#M423396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no luck with it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 08:35:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393755#M423396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T08:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export variable value in Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393756#M423397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you managed to find a solution to your problem? I'm having the same issue too &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2018 12:34:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393756#M423397</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-08T12:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export variable value in Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393757#M423398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry for the late reply..i did as suggested by Gysbert. the variable needs to be evaluated first and then exported.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2018 06:39:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-variable-value-in-Excel/m-p/1393757#M423398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-05T06:39:27Z</dc:date>
    </item>
  </channel>
</rss>

