<?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: Copy Variable value to Excel sheet via Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Copy-Variable-value-to-Excel-sheet-via-Macro/m-p/327003#M120329</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to get a variable's value, use the code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;set v = ActiveDocument.Variables("Variable1")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;msgbox(v.GetContent.String)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to get the user name, you can create a variable in your QVW and use this expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;OSUser()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then in the macro you can get the variable's value as described above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the current date, you can use a variable, or you can use the VBScript funcion "now()".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2011 16:10:07 GMT</pubDate>
    <dc:creator>fosuzuki</dc:creator>
    <dc:date>2011-11-18T16:10:07Z</dc:date>
    <item>
      <title>Copy Variable value to Excel sheet via Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Copy-Variable-value-to-Excel-sheet-via-Macro/m-p/327002#M120328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a macro to write copy objects and write values to Excel.&amp;nbsp; I have a variable called vMaxOrderTimeStamp and I can see the variable has an actual value but the following code in my macro will not copy the value to the Excel spreadsheet.&amp;nbsp; What am I missing?&amp;nbsp;&amp;nbsp; Doesn't work: objExcelDoc.Sheets("About").Range("C8") = vMaxOrderTimeStamp&amp;nbsp; All of the code below works perfectly except this one line:&amp;nbsp; '// Finally select the About sheet objExcelDoc.Sheets("About").Select objExcelDoc.Sheets("About").Range("B2") = chartCaption objExcelDoc.Sheets("About").Range("C4") = "Qlikview Capacity Dashboard Export via AccessPoint" objExcelDoc.Sheets("About").Range("C6") = "Review and Forecast head count "&amp;nbsp; objExcelDoc.Sheets("About").Range("C9") = " SAP (Orders), SFDC (Case History - Phone for Premier), and Avaya (Phone for BC &amp;amp; FD)"&amp;nbsp;&amp;nbsp; I then need to figure out how to get the current User Name and export that value as well as the current date Today():&amp;nbsp; objExcelDoc.Sheets("About").Range("C5") = "Get User Name of person exporting" 'Need to figure out how to get the user name to populate objExcelDoc.Sheets("About").Range("C7") = " Get Current Date" 'Need to figure out how to get current date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 15:15:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Copy-Variable-value-to-Excel-sheet-via-Macro/m-p/327002#M120328</guid>
      <dc:creator />
      <dc:date>2011-11-17T15:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Variable value to Excel sheet via Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Copy-Variable-value-to-Excel-sheet-via-Macro/m-p/327003#M120329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to get a variable's value, use the code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;set v = ActiveDocument.Variables("Variable1")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;msgbox(v.GetContent.String)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to get the user name, you can create a variable in your QVW and use this expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;OSUser()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then in the macro you can get the variable's value as described above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the current date, you can use a variable, or you can use the VBScript funcion "now()".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 16:10:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Copy-Variable-value-to-Excel-sheet-via-Macro/m-p/327003#M120329</guid>
      <dc:creator>fosuzuki</dc:creator>
      <dc:date>2011-11-18T16:10:07Z</dc:date>
    </item>
  </channel>
</rss>

