<?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: Excel export macro with formating in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943523#M325184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm&amp;nbsp; a bit of a beginner at this. So how would your suggestion translate to a module for a button action?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Surely more code would be needed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Nov 2015 14:14:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-05T14:14:24Z</dc:date>
    <item>
      <title>Excel export macro with formating</title>
      <link>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943521#M325182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community, I hope you can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table which has been formatted in various ways, which when I right click and use the 'Send to Excel' function works great, because the formatting is also sent to Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reasons which i won't go into, I have to use a macro to export the table though. But the macro i am using doesn't transfer any of the formatting!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I edit to macro to ensure the formatting is also exported?&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;&lt;/P&gt;&lt;P&gt;FUNCTION ExcelStatus(CH125)&lt;/P&gt;&lt;P&gt;&amp;nbsp; set obj = ActiveDocument.GetSheetObject( CH125)&lt;/P&gt;&lt;P&gt;&amp;nbsp; w = obj.GetColumnCount&lt;/P&gt;&lt;P&gt;&amp;nbsp; if obj.GetRowCount&amp;gt;1001 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; h=1000 &lt;/P&gt;&lt;P&gt;&amp;nbsp; else h=obj.GetRowCount&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set objExcel = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp; objExcel.Workbooks.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp; objExcel.Worksheets(1).select()&lt;/P&gt;&lt;P&gt;&amp;nbsp; objExcel.Visible = True&lt;/P&gt;&lt;P&gt; objExcel.Worksheets(1).Columns(2).ColumnWidth = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; objExcel.Worksheets(1).Columns(3).ColumnWidth = 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objExcel.Worksheets(1).Columns(4).ColumnWidth = 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objExcel.Worksheets(1).Columns(5).ColumnWidth = 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objExcel.Worksheets(1).Columns(6).ColumnWidth = 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objExcel.Worksheets(1).Columns(7).ColumnWidth = 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objExcel.Worksheets(1).Columns(8).ColumnWidth = 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objExcel.Worksheets(1).Columns(9).ColumnWidth = 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objExcel.Worksheets(1).Columns(10).ColumnWidth = 50&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; set CellMatrix = obj.GetCells2(0,0,w,h)&lt;/P&gt;&lt;P&gt;&amp;nbsp; column = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; for cc=0 to w-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; objExcel.Cells(1,column).Value = CellMatrix(0)(cc).Text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; objExcel.Cells(1,column).EntireRow.Font.Bold = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; column = column +1&lt;/P&gt;&lt;P&gt;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&amp;nbsp; c = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; r =2&lt;/P&gt;&lt;P&gt;&amp;nbsp; for RowIter=1 to h-1 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for ColIter=0 to w-1 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objExcel.Cells(r,c).Value = CellMatrix(RowIter)(ColIter).Text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c = c +1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; r = r+1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; c = 1&lt;/P&gt;&lt;P&gt; next&lt;/P&gt;&lt;P&gt;END FUNCTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUB ExportStatus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ExcelExport( "CH125" )&lt;/P&gt;&lt;P&gt;END SUB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 12:17:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943521#M325182</guid>
      <dc:creator />
      <dc:date>2015-11-05T12:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Excel export macro with formating</title>
      <link>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943522#M325183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your macro isn't really an export-routine it's more a read and write routine and only on the values which doesn't cover any formattings. Most often you need to adjust formattings directly within excel and how this could be done is better covered in office-foren.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More suitable instead might be to use a copy+paste routine like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rem ** copy full table to clipboard **&lt;/P&gt;&lt;P&gt;ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to which you find here more: &lt;A href="https://community.qlik.com/docs/DOC-13447"&gt;Export Multiple Chart Objects to Excel and Loop by Field&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternatively especially by complicated formattings could be to use an excel-masterfile which contained all the needs and an export-routine changed only the data within the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 14:01:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943522#M325183</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-11-05T14:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Excel export macro with formating</title>
      <link>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943523#M325184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm&amp;nbsp; a bit of a beginner at this. So how would your suggestion translate to a module for a button action?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Surely more code would be needed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 14:14:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943523#M325184</guid>
      <dc:creator />
      <dc:date>2015-11-05T14:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Excel export macro with formating</title>
      <link>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943524#M325185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a deeper look on the above mentioned link and here: &lt;A href="/t5/forums/searchpage/tab/message?q=excel export"&gt;https://community.qlik.com/search.jspa?q=excel+export&lt;/A&gt; you will find many more examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 14:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Excel-export-macro-with-formating/m-p/943524#M325185</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-11-05T14:25:53Z</dc:date>
    </item>
  </channel>
</rss>

