<?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 running through  load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330047#M410973</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, Thanks for the quick reply &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Angel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Jul 2017 13:03:18 GMT</pubDate>
    <dc:creator>tomovangel</dc:creator>
    <dc:date>2017-07-05T13:03:18Z</dc:date>
    <item>
      <title>Macro running through  load script</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330043#M410969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, community !&lt;BR /&gt;I am new to QlikView, and I am still learning. I have the following macro, which generates excel file, when I execute it through Button ( action) and through PostReload, everything seems to be working, but i want to run it from the load script &lt;/P&gt;&lt;P&gt;this is my macro &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function xlsexport&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'==============================================================&lt;/P&gt;&lt;P&gt;' File Path &amp;amp; Name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Path = "C:\Users\user\Desktop\ARP"&lt;/P&gt;&lt;P&gt; FileName = "ARP"&lt;/P&gt;&lt;P&gt; strSaveFile = Path &amp;amp; FileName&lt;/P&gt;&lt;P&gt;'==============================================================&lt;/P&gt;&lt;P&gt;'Open Excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set oXL=CreateObject("Excel.Application") &lt;/P&gt;&lt;P&gt;oXL.visible=True &lt;/P&gt;&lt;P&gt;oXL.Workbooks.Add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aSheetObj=Array("CH10","CH25","CH52","CH09")&amp;nbsp; ' Chart ID's here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'==============================================================&lt;/P&gt;&lt;P&gt;for i=0 to UBound(aSheetObj)&lt;/P&gt;&lt;P&gt; Set oSH = oXL.ActiveSheet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; num_rows = oSH.UsedRange.Rows.Count&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If num_rows = 1&amp;nbsp; then&lt;/P&gt;&lt;P&gt; oSH.Range("A2").Select&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; Else&lt;/P&gt;&lt;P&gt; oSH.Range("A" &amp;amp; num_rows+4).Select &lt;/P&gt;&lt;P&gt; End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Set obj = ActiveDocument.GetSheetObject(aSheetObj(i))&lt;/P&gt;&lt;P&gt; obj.CopyTableToClipboard True&lt;/P&gt;&lt;P&gt; oSH.Paste &lt;/P&gt;&lt;P&gt; sCaption=obj.GetCaption.Name.v&lt;/P&gt;&lt;P&gt; set obj=Nothing&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;oSH.Cells.Select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;oSH.Columns("A").ColumnWidth = 12.17&lt;/P&gt;&lt;P&gt;oSH.Columns("B").ColumnWidth = 12.17&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If num_rows = 1&amp;nbsp; then&lt;/P&gt;&lt;P&gt;oSH.Range("A" &amp;amp; num_rows).Value = sCaption&lt;/P&gt;&lt;P&gt;oSH.Range("A" &amp;amp; num_rows).Font.Bold = True&lt;/P&gt;&lt;P&gt;'oSH.Range("A" &amp;amp; num_rows).Font.ColorIndex = 3&lt;/P&gt;&lt;P&gt;oSH.Range("A" &amp;amp; num_rows).Interior.ColorIndex = 40&lt;/P&gt;&lt;P&gt; Else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;oSH.Range("A" &amp;amp; num_rows+3).Value&amp;nbsp; = sCaption&lt;/P&gt;&lt;P&gt;oSH.Range("A" &amp;amp; num_rows+3).Font.Bold = True&lt;/P&gt;&lt;P&gt;'oSH.Range("A" &amp;amp; num_rows+3).Font.ColorIndex = 3&lt;/P&gt;&lt;P&gt;oSH.Range("A" &amp;amp;num_rows+3).Interior.ColorIndex = 40&lt;/P&gt;&lt;P&gt; End If&lt;/P&gt;&lt;P&gt; 'oXL.Selection.Columns.AutoFit&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;'==============================================================&lt;/P&gt;&lt;P&gt;&amp;nbsp; oSH.Range("A1").Select&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; oXL.Sheets("Sheet2").Delete&lt;/P&gt;&lt;P&gt;&amp;nbsp; oXL.Sheets("Sheet3").Delete&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oSH.Name = "Data"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; oXL.ActiveWorkBook.SaveAs strSaveFile &amp;amp; replace(date, "/", "-") &amp;amp; ".xlsx" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;set oSH = Nothing&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;set oXL=Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible, to transfer this macro code in a .vbs file, and then execute it in the load script? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice will be highly appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sincerely Yours,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 08:05:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330043#M410969</guid>
      <dc:creator>tomovangel</dc:creator>
      <dc:date>2017-07-05T08:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macro running through  load script</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330044#M410970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;During the load no ActiveDocument exists and therefore all routines which require it won't work. This meant you need to call the export-routine before or after you starts the reload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 12:06:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330044#M410970</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-07-05T12:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro running through  load script</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330045#M410971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but what if I make a variable &lt;BR /&gt;something like &lt;BR /&gt;let ad = ActiveDocument&lt;/P&gt;&lt;P&gt;is it possible to make this workaround ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 12:26:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330045#M410971</guid>
      <dc:creator>tomovangel</dc:creator>
      <dc:date>2017-07-05T12:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro running through  load script</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330046#M410972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It won't change because it does no matter how an object is called - if it didn't exists the call will fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 12:54:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330046#M410972</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-07-05T12:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macro running through  load script</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330047#M410973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, Thanks for the quick reply &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Angel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 13:03:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-running-through-load-script/m-p/1330047#M410973</guid>
      <dc:creator>tomovangel</dc:creator>
      <dc:date>2017-07-05T13:03:18Z</dc:date>
    </item>
  </channel>
</rss>

