<?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 Page numbers with Excel export in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201050#M59326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try this code maybe helpful&lt;/P&gt;&lt;P&gt;Set objExcel = CreateObject("Excel.Application")&lt;BR /&gt;objExcel.Visible = True&lt;/P&gt;&lt;P&gt;Set objDoc = objExcel.Documents.Add()&lt;/P&gt;&lt;P&gt;Set objRange = objDoc.Sections(1).Footers(1).Range&lt;/P&gt;&lt;P&gt;Set objTemplate = objDoc.AttachedTemplate&lt;BR /&gt;objTemplate.AutoTextEntries("Page X of Y").Insert objRange&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Talha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Sep 2009 22:14:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-09-28T22:14:12Z</dc:date>
    <item>
      <title>Page numbers with Excel export</title>
      <link>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201049#M59325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I got a little problem when I export a qv-table to excel. I have to do this with a little macro in vbscript. The excel sheet is created well and I can format it as I like. But I need some data in header and footer of the excelsheet. I can not belive it but it seems to be hard to add a simple "page XY of XYZ" in the footer. Does anybody have an idea how to do this? This does not even count the printpages correct: &lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;xlDoc.Sheets(1).PageSetup.Pages.Count&lt;/PRE&gt;This is the vbscript I wrote: &lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;sub exportXLS() set xlApp = CreateObject("Excel.Application") xlApp.Visible = false set xlDoc = xlApp.Workbooks.Add xlDoc.Sheets(1).activate set obj = ActiveDocument.getsheetobject("CH325") set titel = ActiveDocument.getsheetobject("TX2447") ActiveDocument.GetApplication.WaitForIdle' Set Data obj.CopyTableToClipboard true xlDoc.Sheets(1).cells(4,1).select xlDoc.Sheets(1).paste titel.CopyTextToClipboard xlDoc.Sheets(1).cells(2,1).select xlDoc.Sheets(1).paste 'delete column 9 xlDoc.Sheets(1).Columns(9).clear lastCell = 2 for i = 5 to 6500 if isempty(xlDoc.Sheets(1).cells(i,1)) then lastCell = i exit for end if next ' Set Format with xlDoc.Sheets(1) .cells.mergecells = false .Cells.EntireColumn.AutoFit 'Columnwidth .Columns(1).Columnwidth = 22 'Label .Columns(2).Columnwidth = 50 'Content .Columns(3).Columnwidth = 8.7 'Submittal Date .Columns(4).Columnwidth = 4.3 'Issue .Columns(5).Columnwidth = 7.1 'Package Revision .Columns(6).Columnwidth = 8.7 'Package Date .Columns(7).Columnwidth = 11 'Trade .Columns(8).Columnwidth = 12 'Drawing Type .PageSetup.Orientation = 2 'Landscape .PageSetup.LeftMargin = xlApp.CentimetersToPoints(2.3) .PageSetup.BottomMargin = xlApp.CentimetersToPoints(1.5) .PageSetup.TopMargin = xlApp.CentimetersToPoints(2) .PageSetup.RightMargin = xlApp.CentimetersToPoints(1) .PageSetup.CenterHeaderPicture.FileName .PageSetup.PrintArea = .Range(xlDoc.Sheets(1).cells(1,1),xlDoc.Sheets(1).cells(lastCell,8)).Address .PageSetup.LeftFooter = "Generated on " &amp;amp; Date &amp;amp; " " &amp;amp; Time .PageSetup.RightFooter = xlDoc.Sheets(1).PageSetup.Pages.Count end with With xlDoc.Sheets(1).Cells.Font .Name = "Arial" .Size = 9 End With 'Title rows xlDoc.Sheets(1).Cells(1,1).Font.Size = 18 xlDoc.Sheets(1).Cells(1,1).Font.Color = RGB(112, 112, 112) xlDoc.Sheets(1).Cells(1,1).Font.Bold = True xlDoc.Sheets(1).Cells(2,1).Font.Size = 16 xlDoc.Sheets(1).Cells(2,1).Font.Color = RGB(112, 112, 112) 'Header row with xlDoc.Sheets(1).Range(xlDoc.Sheets(1).Cells(4,1),xlDoc.Sheets(1).Cells(4,8)) .Font.Bold = true .Interior.Color = RGB(172,172,172) .WrapText = true end with xlApp.Visible = trueend sub&lt;/PRE&gt;Thanks for any help.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 20:27:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201049#M59325</guid>
      <dc:creator />
      <dc:date>2009-09-28T20:27:51Z</dc:date>
    </item>
    <item>
      <title>Page numbers with Excel export</title>
      <link>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201050#M59326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try this code maybe helpful&lt;/P&gt;&lt;P&gt;Set objExcel = CreateObject("Excel.Application")&lt;BR /&gt;objExcel.Visible = True&lt;/P&gt;&lt;P&gt;Set objDoc = objExcel.Documents.Add()&lt;/P&gt;&lt;P&gt;Set objRange = objDoc.Sections(1).Footers(1).Range&lt;/P&gt;&lt;P&gt;Set objTemplate = objDoc.AttachedTemplate&lt;BR /&gt;objTemplate.AutoTextEntries("Page X of Y").Insert objRange&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Talha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2009 22:14:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201050#M59326</guid>
      <dc:creator />
      <dc:date>2009-09-28T22:14:12Z</dc:date>
    </item>
    <item>
      <title>Page numbers with Excel export</title>
      <link>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201051#M59327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried it?&lt;/P&gt;&lt;P&gt;.PageSetup.RightFooter ="Pag. &amp;amp;P di &amp;amp;N"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Works! &lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniela&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 14:16:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201051#M59327</guid>
      <dc:creator />
      <dc:date>2009-09-29T14:16:52Z</dc:date>
    </item>
    <item>
      <title>Page numbers with Excel export</title>
      <link>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201052#M59328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt; .LeftHeader = ""&lt;BR /&gt; .CenterHeader = PrinCenterHeader.GetContent.String 'Get variable&lt;BR /&gt; .RightHeader = ""&lt;BR /&gt; .LeftFooter = "Confidential"&lt;BR /&gt; .CenterFooter = ""&lt;BR /&gt; .RightFooter = "Page &amp;amp;P+1 of &amp;amp;N" ''Pagefooter -page xx of xxx&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;/Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 14:25:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201052#M59328</guid>
      <dc:creator />
      <dc:date>2009-09-29T14:25:06Z</dc:date>
    </item>
    <item>
      <title>Page numbers with Excel export</title>
      <link>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201053#M59329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;@Daniela Yes it does! And if someone can tell me how to insert a picture into the header I'm happy at all and can go home and pack up work &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; This won't work. Ends up with unknown runtime error. &lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;.PageSetup.CenterHeaderPicture.FileName = "Picture.jpg"&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;(The pic is in the same path as the qlikview file.)&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 16:42:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201053#M59329</guid>
      <dc:creator />
      <dc:date>2009-09-29T16:42:25Z</dc:date>
    </item>
    <item>
      <title>Page numbers with Excel export</title>
      <link>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201054#M59330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt; .PageSetup.LeftHeaderPicture.Filename = "D:\QV_apps\Finance\Data\Logo\Topbg.jpg"&lt;BR /&gt; .PageSetup.LeftHeader = "&amp;amp;G"&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;/Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 16:56:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201054#M59330</guid>
      <dc:creator />
      <dc:date>2009-09-29T16:56:15Z</dc:date>
    </item>
    <item>
      <title>Page numbers with Excel export</title>
      <link>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201055#M59331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Works! Thanks a lot.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 17:37:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Page-numbers-with-Excel-export/m-p/201055#M59331</guid>
      <dc:creator />
      <dc:date>2009-09-29T17:37:05Z</dc:date>
    </item>
  </channel>
</rss>

