<?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: VBA to Create PivotTable in Nprinting in Qlik NPrinting</title>
    <link>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3874#M100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ruggero, thank you for that information.&amp;nbsp; Is there plans for NPrinting 17 to eventually support .xlsm files? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in this case it doesn't effect me because I am not doing a .xlsm file.&amp;nbsp; The user will never get the code.&amp;nbsp; This is an add-in that I am creating that speeds up the creation of the templates and the end-user will never receive it.&amp;nbsp; Is this, still supported in NPrinting 17?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by the way I figured out my code. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jan 2018 16:17:51 GMT</pubDate>
    <dc:creator>djbloiss</dc:creator>
    <dc:date>2018-01-22T16:17:51Z</dc:date>
    <item>
      <title>VBA to Create PivotTable in Nprinting</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3871#M97</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating an Add-in that will speed up creating Excel reports in Nprinting.&amp;nbsp; The first function I am creating it creating a PivotTable.&amp;nbsp; This is the Code I have created so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub AddPivot()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ReportName As String&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ReportSheet As Worksheet, DataSheet As Worksheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim WorkingBook As Workbook&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set WorkingBook = ActiveWorkbook&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set DataSheet = ActiveSheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; frmReportName.Show&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReportName = Replace(frmReportName.tbReportName.Value, " ", "")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSheet.ListObjects.Add(xlSrcRange, DataSheet.Range(DataSheet.Cells(1, 1), DataSheet.Cells(2, fnFinalColumn(DataSheet))), , xlYes).Name = ReportName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataSheet.Range("A" &amp;amp; fnFinalRow(DataSheet) + 1).Value = "&amp;lt;deleterow&amp;gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ReportSheet = WorkingBook.Sheets.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WorkingBook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=ReportName, Version:=xlPivotTableVersion10).CreatePivotTable TableDestination:=ReportSheet.Range("A1"), _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TableName:="Pivot" &amp;amp; ReportName, DefaultVersion:=xlPivotTableVersion10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReportSheet.Select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReportSheet.Name = ReportName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; With ReportSheet.PivotTables("Pivot" &amp;amp; ReportSheet).PivotCache&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .RefreshOnFileOpen = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .MissingItemsLimit = xlMissingItemsNone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function fnFinalRow(ByVal wsToTest As Worksheet) As Long&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; With wsToTest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fnLastRow = .Cells(.Rows.Count, 1).End(xlUp).Row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&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;Function fnFinalColumn(ByVal wsToTest As Worksheet) As Long&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; With wsToTest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fnLastColumn = .Cells(1, .Columns.Count).End(xlUp).Row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&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;Now, the code looks correct to me but I am receiving an error on this line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataSheet.ListObjects.Add(xlSrcRange, DataSheet.Range(DataSheet.Cells(1, 1), DataSheet.Cells(2, fnFinalColumn(DataSheet))), , xlYes).Name = ReportName&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the error I am receiving.&amp;nbsp; I have stepped through the code and even set watches for Datasheet and checked that ReportName has a value (although ReportName being empty couldn't create that error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing? is this something particular to Nprinting?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jan 2018 15:49:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3871#M97</guid>
      <dc:creator>djbloiss</dc:creator>
      <dc:date>2018-01-19T15:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: VBA to Create PivotTable in Nprinting</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3872#M98</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What NPrinting version are you using? Can you attach your template?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Jan 2018 04:27:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3872#M98</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2018-01-21T04:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: VBA to Create PivotTable in Nprinting</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3873#M99</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;Please note that:&lt;/P&gt;&lt;P&gt;- Qlik NPrinting 16 supports the Office VBA macros in the meaning that you can save an .xlsm template with the VBA code. When Qlik NPrinting generates the report, it copies the VBA code from the template to the reports without executing the macros. The recipents must execute the macros by themselves or you can associate them with the opening event.&lt;/P&gt;&lt;P&gt;- Qlik NPrinting 17 at the moment (November 2017) doesn't support Office macros. The VBA code will not be copied into the generated reports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ruggero&lt;/P&gt;&lt;P&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 09:55:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3873#M99</guid>
      <dc:creator>Ruggero_Piccoli</dc:creator>
      <dc:date>2018-01-22T09:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: VBA to Create PivotTable in Nprinting</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3874#M100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ruggero, thank you for that information.&amp;nbsp; Is there plans for NPrinting 17 to eventually support .xlsm files? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in this case it doesn't effect me because I am not doing a .xlsm file.&amp;nbsp; The user will never get the code.&amp;nbsp; This is an add-in that I am creating that speeds up the creation of the templates and the end-user will never receive it.&amp;nbsp; Is this, still supported in NPrinting 17?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by the way I figured out my code. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 16:17:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3874#M100</guid>
      <dc:creator>djbloiss</dc:creator>
      <dc:date>2018-01-22T16:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: VBA to Create PivotTable in Nprinting</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3875#M101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lech,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I figured out the code. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 16:18:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3875#M101</guid>
      <dc:creator>djbloiss</dc:creator>
      <dc:date>2018-01-22T16:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: VBA to Create PivotTable in Nprinting</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3876#M102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I accidentally replied to myself when I meant to reply to you; so my comment to you is below. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 16:18:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3876#M102</guid>
      <dc:creator>djbloiss</dc:creator>
      <dc:date>2018-01-22T16:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: VBA to Create PivotTable in Nprinting</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3877#M103</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;1 - at the moment I don0t know if and when it will be added&lt;/P&gt;&lt;P&gt;2 - I never tested, sorry. Please let us know the results of your tests. Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ruggero&lt;/P&gt;&lt;P&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 08:33:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/VBA-to-Create-PivotTable-in-Nprinting/m-p/3877#M103</guid>
      <dc:creator>Ruggero_Piccoli</dc:creator>
      <dc:date>2018-01-23T08:33:55Z</dc:date>
    </item>
  </channel>
</rss>

