<?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 Macro to export pivot to excel and create a Line graph in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-export-pivot-to-excel-and-create-a-Line-graph/m-p/1410536#M816503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am using below macro to export a pivot table to excel and create a line graph. Macro exports the pivot to excel and inserting a graph, but it is stopping at &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;x&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;lApp.ActiveChart.ChartType = xlLine. &lt;SPAN style="color: #000000;"&gt;T&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="color: #000000;"&gt;here is some problem with this statement, it stops at this step.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Need help with debugging this. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUB AdHocExport_automated&lt;BR /&gt; confirmation = MSGBOX ("Ad hoc Excel export has been initiated." &amp;amp; vbCrLf &amp;amp; "Do you wish to continue?"&amp;amp; vbCrLf &amp;amp;"", 36, "Export Confirmation")&lt;BR /&gt; IF confirmation = 7 THEN&lt;BR /&gt; EXIT SUB&lt;BR /&gt; END IF&lt;BR /&gt; DIM xlApp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SET xlApp = CREATEOBJECT("Excel.Application")&lt;BR /&gt; xlApp.Visible = TRUE&lt;BR /&gt; SET xlBook = xlApp.Workbooks.Add&lt;BR /&gt; SET xlSheet = xlBook.Worksheets("Sheet1")&lt;BR /&gt; SET Doc = ActiveDocument&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Doc.GetApplication.WaitForIdle&lt;BR /&gt; Doc.GetSheetObject(var).CopyTableToClipBoard TRUE&lt;BR /&gt; xlApp.ActiveSheet.Paste&lt;BR /&gt; xlSheet.Cells.EntireColumn.AutoFit&lt;BR /&gt; xlSheet.Cells.EntireRow.AutoFit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xlApp.Worksheets("Sheet1").Select &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; xlApp.Range("I4").Select&lt;BR /&gt; xlApp.ActiveSheet.Shapes.AddChart.Select&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; xlApp.ActiveChart.ChartType = xlLine&lt;/SPAN&gt;&lt;BR /&gt; xlApp.ActiveSheet.ChartObjects("Chart 1").Activate&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(1).Name = "=Sheet1!$B$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(1).Values = "=Sheet1!$B$2:$B$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(1).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(2).Name = "=Sheet1!$C$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(2).Values = "=Sheet1!$C$2:$C$44"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(2).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(3).Name = "=Sheet1!$D$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(3).Values = "=Sheet1!$D$2:$D$32"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(3).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(4).Name = "=Sheet1!$E$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(4).Values = "=Sheet1!$E$2:$E$20"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(4).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(5).Name = "=Sheet1!$F$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(5).Values = "=Sheet1!$F$2:$F$8"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(5).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt; MSGBOX "Ad hoc Excel export is complete!",64,"Task Completion Notification"&lt;BR /&gt;END SUB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>phoenix</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Macro to export pivot to excel and create a Line graph</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-pivot-to-excel-and-create-a-Line-graph/m-p/1410536#M816503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am using below macro to export a pivot table to excel and create a line graph. Macro exports the pivot to excel and inserting a graph, but it is stopping at &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;x&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;lApp.ActiveChart.ChartType = xlLine. &lt;SPAN style="color: #000000;"&gt;T&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="color: #000000;"&gt;here is some problem with this statement, it stops at this step.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Need help with debugging this. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUB AdHocExport_automated&lt;BR /&gt; confirmation = MSGBOX ("Ad hoc Excel export has been initiated." &amp;amp; vbCrLf &amp;amp; "Do you wish to continue?"&amp;amp; vbCrLf &amp;amp;"", 36, "Export Confirmation")&lt;BR /&gt; IF confirmation = 7 THEN&lt;BR /&gt; EXIT SUB&lt;BR /&gt; END IF&lt;BR /&gt; DIM xlApp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SET xlApp = CREATEOBJECT("Excel.Application")&lt;BR /&gt; xlApp.Visible = TRUE&lt;BR /&gt; SET xlBook = xlApp.Workbooks.Add&lt;BR /&gt; SET xlSheet = xlBook.Worksheets("Sheet1")&lt;BR /&gt; SET Doc = ActiveDocument&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Doc.GetApplication.WaitForIdle&lt;BR /&gt; Doc.GetSheetObject(var).CopyTableToClipBoard TRUE&lt;BR /&gt; xlApp.ActiveSheet.Paste&lt;BR /&gt; xlSheet.Cells.EntireColumn.AutoFit&lt;BR /&gt; xlSheet.Cells.EntireRow.AutoFit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xlApp.Worksheets("Sheet1").Select &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; xlApp.Range("I4").Select&lt;BR /&gt; xlApp.ActiveSheet.Shapes.AddChart.Select&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; xlApp.ActiveChart.ChartType = xlLine&lt;/SPAN&gt;&lt;BR /&gt; xlApp.ActiveSheet.ChartObjects("Chart 1").Activate&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(1).Name = "=Sheet1!$B$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(1).Values = "=Sheet1!$B$2:$B$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(1).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(2).Name = "=Sheet1!$C$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(2).Values = "=Sheet1!$C$2:$C$44"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(2).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(3).Name = "=Sheet1!$D$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(3).Values = "=Sheet1!$D$2:$D$32"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(3).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(4).Name = "=Sheet1!$E$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(4).Values = "=Sheet1!$E$2:$E$20"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(4).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection.NewSeries&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(5).Name = "=Sheet1!$F$1"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(5).Values = "=Sheet1!$F$2:$F$8"&lt;BR /&gt; xlApp.ActiveChart.SeriesCollection(5).XValues = "=Sheet1!$A$2:$A$56"&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt; MSGBOX "Ad hoc Excel export is complete!",64,"Task Completion Notification"&lt;BR /&gt;END SUB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-pivot-to-excel-and-create-a-Line-graph/m-p/1410536#M816503</guid>
      <dc:creator>phoenix</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export pivot to excel and create a Line graph</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-pivot-to-excel-and-create-a-Line-graph/m-p/1410537#M816504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Try this,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;xlApp.ActiveChart.ChartType = 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Reference Link:&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;A href="https://msdn.microsoft.com/en-us/library/bb241008(v=office.12).aspx" title="https://msdn.microsoft.com/en-us/library/bb241008(v=office.12).aspx"&gt;XlChartType Enumeration [Excel 2007 Developer Reference]&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 03:43:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-pivot-to-excel-and-create-a-Line-graph/m-p/1410537#M816504</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2017-09-14T03:43:06Z</dc:date>
    </item>
  </channel>
</rss>

